Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

JEditorPane timeout

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey all,
What does it take to be more than a greenhorn? Anyway, I've got the following class. Unfortunately, every time I try and run it it gives me a connection timeout error. I looked in the java api docs but find nothing about timeouts related to the JEditorPane. Thanks much,
Tetsuo!
>> Code follows...
 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
Actually, you should expect getting timeout when you want to load URL page. The setPage method actually opens a connection to the page you specified.
if you put e.printStackTrace(); in the catch, you will get this:


connect (code=10051)
java.net.SocketException: connect (code=10051)
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:320)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:133)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:120)
at java.net.Socket.<init>(Socket.java:273)
at java.net.Socket.<init>(Socket.java:100)
at sun.net.NetworkClient.doConnect(NetworkClient.java:50)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:335)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:521)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:271)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:281)
at sun.net.www.http.HttpClient.New(HttpClient.java:293)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection
.java:404)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
nection.java:497)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:230
)
at javax.swing.JEditorPane.getStream(JEditorPane.java:539)
at javax.swing.JEditorPane.setPage(JEditorPane.java:320)
at javax.swing.JEditorPane.setPage(JEditorPane.java:640)
at Browser.<init>(Browser.java:26)
at Browser.main(Browser.java:39)


You see, you got a socket error.
kawaii
 
Tetsuo Suzuki
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay, I was under the assumption that the setPage method would retrieve the content and display it in the JEditorPane...
 
reply
    Bookmark Topic Watch Topic
  • New Topic