Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Handling Javascript and CSS in JEditorPane

843806Oct 31 2007
I am just beginning to play around with java.net and URLs, and have the following code snippet:
URL home = new URL("http://www.google.com");
JEditorPane ep = new JEditorPane();
ep.setPage(home);
ep.setEditable(false);
ep.addHyperlinkListener(new HLinkListener(ep));
JScrollPane scroll = new JScrollPane(ep);
Where the JEditorPane is inside of a JFrame, and HLinkListener is a seperate class with just the HyperlinkListener interface and hyperlinkUpdate method.

This works for what I want it to, just a basic GUI representation of a URL, but is unable to handle any pages that involve CSS or JavaScript. Google has turned up many all inclusive packages, like Cobra, but what I was wondering is if anybody has any experience with a particular Java JS/CSS parser, or if there was a basic way, ie one with only a couple of imports and new objects, that would allow JS and CSS to be displayed.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 28 2007
Added on Oct 31 2007
0 comments
318 views