Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Webpage not opening inside jeditorpane  RSS feed

 
Mahadeva Rao
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Iam not able to open webpage inside a jeditorpane (jeditorpane is inside a tabbed pane). My code for jeditorpane is



Any ideas on this.

Thanks
 
Randall Twede
Ranch Hand
Posts: 4690
8
Java Scala
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i think your problem is here
editorPane.setPage(url);
url is a String not a URL

i can show you what i did which works. i used a JTextPane inside a JScrollPane

 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.
Mahadeva Rao wrote:Iam not able to open webpage inside a jeditorpane (jeditorpane is inside a tabbed pane). My code for jeditorpane is

What "does not able to open" mean? What happens when you run the code? Please TellTheDetails.
You also need to double check you added the JEditorPane to the JTabbedPane and the JTabbedPane to the JFrame. If everything seems correct, then please post your SSCCE code (In your case, a JFrame with a JEditorPane)

Randall Twede wrote:i think your problem is here
editorPane.setPage(url);
url is a String not a URL

Nope. The setPage is overloaded to accept a String as well as URL
 
Campbell Ritchie
Marshal
Posts: 55678
161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome again
I have added code tags to your post, and you can see how much better the code now looks.
 
Andrea Binello
Ranch Hand
Posts: 48
4
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just one note: JEditorPane supports only HTML 3.2, Javascript is not managed at all and CSS support is present but rather limited. This just to say that JEditorPane is not very suitable to display modern, stylish, dynamic web sites. Don't expect to have the same "experience" as in real browsers.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Andrea Binello wrote:Just one note: JEditorPane supports only HTML 3.2, Javascript is not managed at all and CSS support is present but rather limited. This just to say that JEditorPane is not very suitable to display modern, stylish, dynamic web sites. Don't expect to have the same "experience" as in real browsers.

Indeed. One might want to explore more suitable options like Lobo
 
Mahadeva Rao
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,

Thanks for reply,
I have my above code customized in a jeditorpane which is present in a scroll pane, scroll pane is in a jtabbedpane, and jtabbedpane is in a jframe. When i try to run the above file the url (google) is not displayed, just a blank window and even though my above code has seteditable as false, iam able to enter text in the jeditorpane.

I have 2 tabs and in 1 tab i have the following code which opens the url in my browser, but i want the url to open in my tab not in browser.


The other tab has the following code but doesnot display the url.


Any ideas would be helpful.
 
Mahadeva Rao
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Maneesh Godbole,

I saw many posts to use LOBO browser, iam beginner in java can you let me know how to use that browser in my project?.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Example code on how to embed Lobo in a Swing app can be found at http://lobobrowser.org/browser/api-info.jsp
 
Mahadeva Rao
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Maneesh \ Ulf Dittmer ,

Tried adding lobo browser but when i run my file, the output shows processing and url is not displayed.

I have tried 1st and 2nd example from lobo browser link below.

http://lobobrowser.org/browser/api-info.jsp
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!