-2

i am working with java SE application, but i want to add a web view inside my application (or any other suggestion to view online web content inside JFrame) but it should work as good as web view, please guys help me out

Puce
  • 37,247
  • 13
  • 80
  • 152
developer33
  • 11
  • 1
  • 6

3 Answers3

2

There is a way to integrate JavaFX controls in Swing components, but AFAIK getting the details right such event handling etc. is a bit tricky.

http://docs.oracle.com/javase/8/javafx/interoperability-tutorial/fx_swing.htm#JFXIP561

Puce
  • 37,247
  • 13
  • 80
  • 152
0

Yes, you can. There is nice example at Oracle's site.

Thankfully to interaction WebEngine you can also customise interface, layout, tabs and much more. Here is a simple example how to load content into WebView:

final String url = "https://www.wikipedia.org/";
WebView browser = new WebView();
WebEngine webEngine = browser.getEngine();
webEngine.load(url);
Andrii Abramov
  • 10,019
  • 9
  • 74
  • 96
0

You can Use JScrollPane(JEditorPane) , you might want to look at That.

Or Try JxBrowser , JxBrowser can be used to display modern web pages and HTML+CSS+JavaScript content in your Java applications. It allows building GUI of your cross-desktop application using any popular HTML5 UI toolkit.

See this : http://java.dzone.com/articles/web-browser-your-java-swing.