This section shows you SWT Browser
In SWT, the class Browser of package org.eclipse.swt.browser allows to create a browser. In the given example, the class Browser implements the browser and allows the user to navigate through HTML documents. The class Text creates the text field for the URL.
The Listener class is called to perform the action on ToolItems. The method browser.back() navigate to the previous session, the method browser.forward() navigates to the next session, the method browser.refresh() refresh the current page, the method browser.stop() stops the loading and rendering activity. The method browser.setUrl(text.getText()) loads the URL by getting the text from the text box.
Following code loads the given URL:
| browser.setUrl("http://www.roseindia.net"); |
Here is the code of BrowserExample.java
import org.eclipse.swt.SWT;
|
Output will be displayed as:

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: SWT Browser View All Comments
Post your Comment