File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes To display webpage in JEditorpane Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "To display webpage in JEditorpane" Watch "To display webpage in JEditorpane" New topic

To display webpage in JEditorpane

Deepak Kamboj

Joined: Jun 19, 2000
Posts: 7
Hi Shin!
I am making a webbrowser in java using JEditorpane. The program displays a page in JEditopane but there is some problems. Firstly it doesnot display webpage as it looks in IE or Netscape Navigator. i.e. the image is aligned right in HTML code. but it displays it in left. If a heading is alignrd left it displays it in center. So please suggest me what I can do ?
With regards,
Deepak Kamboj
Ranch Hand

Joined: Nov 21, 2000
Posts: 71
I have faced similar problem with not quite the web page, but I created a document in a word with links and stuff then saved into an html file. then I tried to load that html doc in JEditor pane, the display was nowhere near to the one in IE, Opera or so on. Later I found out this was due to the way somw html docs have style features associated with it for which there is no support in using JEditorPane. In fact you can do only very basic with Jeditorpane when we deal with html files. I hope it improves in the near future, otherwise we will have to reply on invoking IE or netscape or opera, whatever is istalled on local computer to display html pages.
My personal suggestion to you would be, if suitable to you of course, is use one of the readily available class to invoke IE from underlying system and then go from ther, forget about java-html browser for time being. Even if you find oure java-html browser with full support, it will be dead slow.
However its been about six months since I looked around for this kind of stuff, so if you find better solution please let me know.
I agree. Here's the link:
subject: To display webpage in JEditorpane
It's not a secret anymore!