wood burning stoves*
The moose likes Swing / AWT / SWT and the fly likes Opening web pages in swing application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Opening web pages in swing application" Watch "Opening web pages in swing application" New topic
Author

Opening web pages in swing application

shiva machhewar
Greenhorn

Joined: Aug 13, 2011
Posts: 4
I need to open a web page in swing application. Once it is opened I am required to take information for every click on every link because I want to do web harvesting on the respective and corresponding further pages.
I tried to google it but, all I got is JXbroswer api which is the paid one. If I could get some other suggestions that would be great. Thanks in advance. Looking forward for response.
Kemal Sokolovic
Bartender

Joined: Jun 19, 2010
Posts: 825
    
    5

JEditorPane can be used to display web pages and with appropriate listener (HyperlinkListener) component get's notified each time user clicks on a link so you can further process it.


The quieter you are, the more you are able to hear.
shiva machhewar
Greenhorn

Joined: Aug 13, 2011
Posts: 4
First of all thanks for the reply.
But JEditorPane does not provide support for Rich internet applications. It does not provide support for html5 and now a days most of the websites are moving to html5. If you have some other option that would have been helpful.
Kemal Sokolovic
Bartender

Joined: Jun 19, 2010
Posts: 825
    
    5

Well, you said nothing in your original post about HTML5, and I quote:
I need to open a web page in swing application. Once it is opened I am required to take information for every click on every link because I want to do web harvesting on the respective and corresponding further pages.


As for further requirement about HTML5, you will probably have to take a look around for a custom component that will provide functionalities you need, or develop one yourself. Or, perhaps some Ranchers can point you in the right direction.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42913
    
  68
Yep, JEditorPane supports HTML 3.2 and nothing else, nor is it likely that it ever will. For something more advanced (although just as dormant) check out http://lobobrowser.org/

For programmatic access to web pages -such as scraping- a much better (and up-to-date) solution is the HtmlUnit library.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Opening web pages in swing application