0

I am using JSoup to parse certain web pages. However, I also want to display the pages to the user, while I parse the HTML content of the page in the background.

JSoup is awesome for HTML parsing etc., but does not seem to have a GUI component. What are the recommended ways to plug in a GUI component to display web pages that I am parsing with JSoup?

Moeb
  • 10,527
  • 31
  • 84
  • 110
  • Viewing HTML in/with Java was always painfull. Propably JavaFX2 makes it usable for the first time from Java SE: http://docs.oracle.com/javafx/2/webview/jfxpub-webview.htm – PeterMmm Nov 18 '13 at 07:52
  • 1
    Umm… HTML itself *is* a GUI. We call that GUI a "web page". What exactly do you want to show? Where do you want to show it, in a Swing app? – Basil Bourque Nov 18 '13 at 07:58
  • @BasilBourque HTML describes a potential GUI. You could easily just not render it (e.g. view it in a text editor; it's still HTML). – Jason C Nov 21 '13 at 05:57

1 Answers1

3

JSoup is a parser, not a GUI builder. Of course it doesn't have GUI components.

If you want to display the website from an HTML file, use a JEditorPane (see here Display a webpage inside a swing application), I suppose this will work on a local copy as well.
If you want to display the parsed data in your own format, use Swing to build a GUI.

To my knowledge, Java Swing Components will parse HTML. You can simply make a JTextArea to display the raw HTML, it should automatically convert it back to a formatted page. I have personally used a JList to display HTML formatted data.

See How to Use HTML in Swing Components

Community
  • 1
  • 1
Ron
  • 1,450
  • 15
  • 27