Tutorial by Examples

WebView wv = new WebView(); WebEngine we = wv.getEngine(); we.load("https://stackoverflow.com"); WebView is the UI shell around the WebEngine. Nearly all controls for non UI interaction with a page are done through the WebEngine class.
WebHistory history = webView.getEngine().getHistory(); The history is basically a list of entries. Each entry represents a visited page and it provides access to relevant page info, such as URL, title, and the date the page was last visited. The list can be obtained by using the getEntries() met...
private final Logger logger = Logger.getLogger(getClass().getCanonicalName()); WebView webView = new WebView(); webEngine = webView.getEngine(); webEngine.setOnAlert(event -> logger.warning(() -> "JS alert: " + event.getData()));
When using a WebView to display your own custom webpage and this webpage contains Javascript, it might be necessary to establish a two-way communication between the Java program and the Javascript in the web page. This example shows how to setup such a communication. The webpage shall display an i...

Page 1 of 1