Re: JTextArea append method doesn't always append



Andrew Thompson wrote:

Andrew Thompson wrote:
Is this a bug in JTextArea, or is this some known behavior?

Oh, but besides all that 'rabbiting on', note that
Swing methods are not 'Thread safe'.

See

<http://java.sun.com/javase/6/docs/api/javax/swing/SwingUtilities.html#invokeLater(java.lang.Runnable
)>


However, JTextArea.append() is one of the few Swing methods which is thread
safe:
<http://java.sun.com/javase/6/docs/api/javax/swing/JTextArea.html#append(java.lang.String)>

My first thought was that the multiple threads appending to multiple JTextAreas
was the problem, and that wrapping the calls in invokeLater would be the
solution. Since the method is supposed to be thread safe this ought not to be
the case, if this is indeed the class/method which is being used. It might
still be worth trying anyway...

I agree with your other post. A SSCCE which demonstrates the problem might shed
some light on it.

--
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : nmw@xxxxxxxxxxxx
Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
.



Relevant Pages

  • Re: JTextArea append method doesnt always append
    ... Swing methods are not 'Thread safe'. ... JTextArea.appendis one of the few Swing methods which is ... My first thought was that the multiple threads appending to multiple ... and within an invokeLater thread. ...
    (comp.lang.java.gui)
  • Re: JTextArea append method doesnt always append
    ... Andrew Thompson wrote: ... JTextArea.appendis one of the few Swing methods which is thread ... thread safe. ... University of Leicester, Leicester, LE1 7RH, UK ...
    (comp.lang.java.gui)