File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JavaFX and the fly likes Open Web pages inside JavaFX  Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JavaFX
Bookmark "Open Web pages inside JavaFX  " Watch "Open Web pages inside JavaFX  " New topic
Author

Open Web pages inside JavaFX

Ksh Aggarwal
Greenhorn

Joined: Sep 16, 2009
Posts: 28
Hi,

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);
panel.add(pane);
}



and the JDIC library

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


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
Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Open Web pages inside JavaFX
 
Similar Threads
opening link in new window
Open HTML file in desktop app
How to make a JavaBrowser
Open a Web Page inside a jDesktopPane
Link to open using JEditor Pane