Recently, I came across an interesting article at this link: http://docs.oracle.com/javafx/2/webview/jfxpub-webview.htm. The article demonstrates how to develop a java application utilizing the javafx library and utilizing classes like WebEngine and WebView to showcase a web page within the app, effectively transforming it into a browser.
The key points highlighted in the article include:
The embedded browser component uses WebKit, an open-source web browser engine, supporting CSS, JavaScript, DOM, and HTML5.
With the embedded browser, you can perform various tasks within your JavaFX applications:
- Show HTML content from local or remote URLs
- Access Web history
- Execute JavaScript commands
- Enable communication between JavaScript and JavaFX
- Handle web pop-up windows
- Apply effects to the embedded browser
I am considering eliminating the use of Java or JavaFX GUI tools entirely, except for those necessary for displaying HTML and CSS as outlined in the article. Instead, I aim to create the entire user interface for my app using HTML and CSS with various HTML buttons triggering events in my java code.
Do you think this approach is viable? Moreover, if it appears sound to me, I'm curious why anyone would opt for another method to construct a GUI in java.