advertising your dating site - Jtextpane not updating real time

//JScroll Pane variable pane initialized with JText Area area //We will update area with new text JText Area temp = (JText Area) View Port()View(); //new text to add JText Area c = new JText Area(); c.append("text \n)"; //update through pointers temp = c; pane.validate(); Thank you for your interest in this question.

Edit It has been pointed out that JText Area's append function actually is thread safe (unlike most Swing functions).

Therefore, for this particular, case it is not necessary to update it via invoke Later.

Basically what I'm trying to do is I have display going on in my JPanel of a JText Pane.

I have a button that edits the value of the string that's supposed to be displayed in the JText Pane. This means that there is no way you can reference them anywhere else from with your program.

You can for example use a Not sure what you are asking, the title seems to be saying that the text isnt updating, but your question seems to indicate that is isnt being inserted where you want it to be...

However, instead of updating the text area after each iteration of the loop when set Text is called, it appears to only update the text when all the runs of the task are done. You are using swing basic threads called initial threads. In my exmaple below the actual work starts from the EDT thread as it is from a button click Action Listener.Anything that affects or makes use of GUI components in Swing must done on a special thread called the Event Dispatch Thread (EDT).If your code snippet, if it's freezing the GUI, I imagine that it is being run in the EDT.How to insert your text at the start is already answered.The other part of your question is the same as always ...I can't figure out how to update the JText Pane however. Instead, make those components you need to reference else where instance fields.

Tags: , ,