OK so this is the code I have. Basically it gets a URL entered by a user into a JTextField then connects to the page and outputs the result into a JEditorPane - which doesn't support HTML and CSS very well. So I am trying to use HTMLParser to parse the HTML in the webpages and maybe use another package to parse CSS?
URL pageToLoad = new URL(url);
URLConnection pageConnect = pageToLoad.openConnection();
pageConnect.connect();
addressField.setText(url);
Parser htmlparser = new Parser(url);
System.out.println("Parsing: " + htmlparser.getURL());
NodeList list = htmlparser.parse(null);
pageViewer.setPage(list.toHtml());
But it doesn't work properly. If I use System.out.println(list.toHtml()) then it outputs the HTML in DOS but not as a page to the JEditorPane?
I don't understand why and need help. :(
Thanks in advance. ;D
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
OK so this is the code I have. Basically it gets a URL entered by a user into a JTextField then connects to the page and outputs the result into a JEditorPane - which doesn't support HTML and CSS very well. So I am trying to use HTMLParser to parse the HTML in the webpages and maybe use another package to parse CSS?
URL pageToLoad = new URL(url);
URLConnection pageConnect = pageToLoad.openConnection();
pageConnect.connect();
addressField.setText(url);
Parser htmlparser = new Parser(url);
System.out.println("Parsing: " + htmlparser.getURL());
NodeList list = htmlparser.parse(null);
pageViewer.setPage(list.toHtml());
But it doesn't work properly. If I use System.out.println(list.toHtml()) then it outputs the HTML in DOS but not as a page to the JEditorPane?
I don't understand why and need help. :(
Thanks in advance. ;D