• Post Reply Bookmark Topic Watch Topic
  • New Topic

Open Web pages inside JavaFX  RSS feed

Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Im trying to open web pages in a javafx window. For reference i am using the following link (http://javafx.com/samples/ExercisingSwing/index.html) where the author has shown a map inside javaFX window.

I am modifying the code to use a JPanel instead on JXMapViewer.
I have tried both JEditorPane

String google = "www.google.com";
JEditorPane pane;

try {
pane= new JEditorPane(google);

and the JDIC library

final WebBrowser webBrowser = new WebBrowser();
//webBrowser.setURL(new URL("file://D:\\test.html"));
webBrowser.setURL(new URL("http://www.google.com"));
} catch (MalformedURLException e) {

to open simple local html files and google.com but they are never shown in the javaFX window. Adding a JLabel to the panel works and is shown. Putting text in the JEditorPane also works, but not a URL.

Please Help
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!