Results 1 to 1 of 1
- 10-10-2011, 10:00 PM #1
Member
- Join Date
- Oct 2011
- Posts
- 2
- Rep Power
- 0
html in JTextPane/JEditorPane not displayed after applet restart on webPage refresh
Hello,
I have a signed applet. a web page (asks for permissions and) loads and the applet and performs some information processing and writes data to a text file.
Then the web page refreshes a few components and gives the applet a different CSS class (to move it to other position on the page) and the applet reloads, reads data from file and must load it as html into JTextPane.
The problem: when the applet reloads it is given a parameter from html code. This way it knows the now it must display the information to the JTextPane as a list of links in html format. But the JTextPane displays nothing.
I tried to load the html as a simple text and it worked. I also tried to run the applet with the parameter to display data from the very start (when webpage asks for permission to run the applet) and it worked.
So in short I the problem is that when the applet initializes and loads data from the start everything is fine but if it first performs inf. processing and then reloads it cant display html in JTextPane.
I am using javax.swing.JApplet; for applet.
This is the initialization of the applet. It starts the applet as a thread.
jbInit() builds/adds visulal components on the applet.Java Code:public void init() { try { jbInit(); new Thread(this, "processFunctionThread").start();
public void run() has the main function that (depending on the passed from html parameter) performs actions.Java Code:displayEditorPane = new JEditorPane(); displayEditorPane.setContentType("text/html"); displayEditorPane.setEditable(true); displayEditorPane.addHyperlinkListener(this); displayEditorPane.setBounds(new Rectangle(10, 10, 260, 365)); displayEditorPane.setContentType("text/html"); dataScrolling = new JScrollPane(displayEditorPane); dataScrolling.setBounds(new Rectangle(10, 10, 260, 365)); dataScrolling.setVisible(true);
Java Code:if ( getParameter("scan").equals("doscan") ) { // performs initial information processing } else if(getParameter("scan").equals("scanresults")) { // after the web page gives the applet a different css class it reloads and displays data to JTextPane. }
It's the same either with JEditorPane or with JTextPane.
Please, help me! Thanks
Similar Threads
-
JEditorPane / JTextPane help needed!
By Ruuhkis in forum New To JavaReplies: 0Last Post: 03-07-2011, 08:16 PM -
Format editing in HTML view with JEditorPane
By peterme in forum Advanced JavaReplies: 4Last Post: 02-23-2011, 09:05 PM -
HTML and CSS in JEditorPane.setPage
By mine0926 in forum New To JavaReplies: 4Last Post: 09-22-2010, 09:21 AM -
JEditorPane, HTML 4.0, CSS, custom Tags
By AndreB in forum AWT / SwingReplies: 4Last Post: 12-22-2009, 10:45 AM -
jeditorpane help parsing html
By asifsolkar in forum Advanced JavaReplies: 4Last Post: 12-14-2007, 05:23 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks