Results 1 to 11 of 11
Thread: [SOLVED] JEditorPane bug?
- 03-27-2009, 03:45 PM #1
Member
- Join Date
- Sep 2008
- Posts
- 38
- Rep Power
- 0
[SOLVED] JEditorPane bug?
hi, im trying to display a webpage in a jeditor pane using its setPage method,
but when i try to skip back an forth to the content(source, and normal view) its seems to produce some runtime error.
i tried clearing the pane between the two contents but that does not work...
info on the net tells me this is a editorpane bug.
Can someone point me to the solution?
thanks
- 03-27-2009, 05:33 PM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Can you send here your complete error message to see.
- 03-28-2009, 01:37 PM #3
Member
- Join Date
- Sep 2008
- Posts
- 38
- Rep Power
- 0
Tis is the method that is incorrect, i guess...
thanks
Java Code:private void getThePage(String location) { location = "http://" + location; if ((box.getSelectedItem()) == "normal") { try { contentsArea.setPage(location); //field.setText(location); } catch(IOException ex) { JOptionPane.showMessageDialog(this, ex.toString(), "bad url", JOptionPane.ERROR_MESSAGE); } } if ((box.getSelectedItem()) == "source") { try { URL myRequest = new URL(location); BufferedReader inMessage = new BufferedReader(new InputStreamReader(myRequest.openStream())); String httpReplay, content = ""; while ((httpReplay = inMessage.readLine()) != null) { httpReplay = inMessage.readLine(); contentsArea.setText(content + httpReplay + "\n"); content = contentsArea.getText(); } inMessage.close(); } catch(MalformedURLException ex) { JOptionPane.showMessageDialog(this, ex.toString(), "bad url", JOptionPane.ERROR_MESSAGE); } catch(IOException ex) { JOptionPane.showMessageDialog(this, ex.toString(),"IO_error", JOptionPane.ERROR_MESSAGE); } }Last edited by shwein; 03-28-2009 at 05:51 PM.
- 03-28-2009, 01:38 PM #4
Member
- Join Date
- Sep 2008
- Posts
- 38
- Rep Power
- 0
sry wrong code tags :)
- 03-28-2009, 05:02 PM #5
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Lol, can you send the full error message you get there. It's difficult to say more about your code, since we don't have more details.
- 03-28-2009, 05:03 PM #6
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
- 03-28-2009, 05:54 PM #7
Member
- Join Date
- Sep 2008
- Posts
- 38
- Rep Power
- 0
sry, my bad
Last edited by shwein; 03-29-2009 at 05:49 PM.
- 03-31-2009, 03:19 AM #8
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
- 03-31-2009, 02:54 PM #9
Member
- Join Date
- Sep 2008
- Posts
- 38
- Rep Power
- 0
nope, but i worked around it ;)
- 04-01-2009, 03:21 AM #10
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
But I've seen that you mark the thread solved. ;)
- 04-01-2009, 12:36 PM #11
Member
- Join Date
- Sep 2008
- Posts
- 38
- Rep Power
- 0
Similar Threads
-
Javascript in JEditorpane
By Narayan15 in forum AWT / SwingReplies: 1Last Post: 03-27-2009, 05:49 PM -
JEditorPane Example
By Java Tip in forum javax.swingReplies: 0Last Post: 06-27-2008, 07:47 PM -
insertHTML in a JEditorPane
By olbion in forum New To JavaReplies: 1Last Post: 05-05-2008, 12:30 PM -
jeditorpane help parsing html
By asifsolkar in forum Advanced JavaReplies: 4Last Post: 12-14-2007, 05:23 AM -
JEditorPane
By drmmr11 in forum Java AppletsReplies: 0Last Post: 08-02-2007, 06:08 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks