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