• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java Browser not displaying Google.  RSS feed

 
Joshua Rodrigues
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For some reason, my web browser isn't displaying any web page. When I create the method editorPane.setPage(), it takes forever (about 20 seconds) to show nothing. It'll load the web browser after the 20 seconds of waiting. Here is my code:
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Desktop and TaskBar are not part of the JRE, so it's hard to say what might be going on. Can you post an SSCCE?
 
Joshua Rodrigues
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:Desktop and TaskBar are not part of the JRE, so it's hard to say what might be going on. Can you post an SSCCE?

Desktop:

TaskBar:

Everything within the Java OS freezes when I open up the Browser but only if setPaeg(url) is set. If it's not set, the Browser will open up normally. I also cannot get any of my JInternalFrames to become resizable. Yes, I did set the value of resizable within the constructor to true, so I'm lost as to what I did wrong there. Any ideas?
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's hard to speculate on what is going on, beyond guessing that accessing the URL is done synchronously on the event thread (doing anything time-consuming on the event thread is a big no-no, as it will freeze all other GUI activity). Maybe there's a problem with the network connection. The SSCCE posted below finishes quickly for me.

the Java OS

So this is not a standard OS with a JVM running?

 
Rob Spoor
Sheriff
Posts: 21092
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JEditorPane is very limited to the HTML it can display. I doubt it handles JavaScript in any way, and Google uses a lot of JavaScript. If want to create a proper web browser in Java, check out JavaFX. It has a proper browser component that uses WebKit.
 
Joshua Rodrigues
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:It's hard to speculate on what is going on, beyond guessing that accessing the URL is done synchronously on the event thread (doing anything time-consuming on the event thread is a big no-no, as it will freeze all other GUI activity). Maybe there's a problem with the network connection. The SSCCE posted below finishes quickly for me.

When I print out a stack trace instead of a JOptionPane, I get a connection reset error. No idea why.
Ulf Dittmer wrote:
So this is not a standard OS with a JVM running?

It's a Java OS - not a pure one, but a basic one.
Rob Spoor wrote:JEditorPane is very limited to the HTML it can display. I doubt it handles JavaScript in any way, and Google uses a lot of JavaScript. If want to create a proper web browser in Java, check out JavaFX. It has a proper browser component that uses WebKit.

I'd rather create one in Swing just for fun. I'll create a second one with JavaFX later but I would also rather fix my current one.

I'm still lost as to why it takes so long to set the page on a JEditorPane even though nothing gets set on the it. Anyone else know why?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!