Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #2150

Re: JTextArea append meth

Path csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!news.glorb.com!news-out.readnews.com!news-xxxfer.readnews.com!news-out.news.tds.net!newsreading01.news.tds.net!86597e80!not-for-mail
From "Lee Graba" <lee.graba@THRWHITE.remove-dii-this>
Subject Re: JTextArea append meth
Message-ID <13ailgpalksg35a@corp.supernews.com> (permalink)
X-Comment-To comp.lang.java.gui
Newsgroups comp.lang.java.gui
In-Reply-To <f89vq6$og3$1@south.jnrs.ja.net>
References <f89vq6$og3$1@south.jnrs.ja.net>
Content-Type text/plain; charset=IBM437
Content-Transfer-Encoding 8bit
X-Gateway time.synchro.net [Synchronet 3.15a-Win32 NewsLink 1.92]
Lines 46
Date Wed, 27 Apr 2011 15:37:28 GMT
NNTP-Posting-Host 96.60.20.240
X-Complaints-To news@tds.net
X-Trace newsreading01.news.tds.net 1303918648 96.60.20.240 (Wed, 27 Apr 2011 10:37:28 CDT)
NNTP-Posting-Date Wed, 27 Apr 2011 10:37:28 CDT
Organization TDS.net
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.gui:2150

Show key headers only | View raw


  To: comp.lang.java.gui
Nigel Wade wrote:

> 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.
> 

Actually, I have done this both ways, calling append in a separate thread,
and within an invokeLater thread.  Same results either way.

-- 
=================
Lee Graba
leegraba@visi.com
=================

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.gui | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

JTextArea append method d "Lee Graba" <lee.graba@THRWHITE.remove-dii-this> - 2011-04-27 15:37 +0000
  Re: JTextArea append meth "Roedy Green" <roedy.green@THRWHITE.remove-dii-this> - 2011-04-27 15:37 +0000
    Re: JTextArea append meth "Lee Graba" <lee.graba@THRWHITE.remove-dii-this> - 2011-04-27 15:37 +0000
      Re: JTextArea append meth "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:37 +0000
        Re: JTextArea append meth "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:37 +0000
          Re: JTextArea append meth "Nigel Wade" <nigel.wade@THRWHITE.remove-dii-this> - 2011-04-27 15:37 +0000
            Re: JTextArea append meth "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:37 +0000
              Re: JTextArea append meth "Nigel Wade" <nigel.wade@THRWHITE.remove-dii-this> - 2011-04-27 15:37 +0000
            Re: JTextArea append meth "Lee Graba" <lee.graba@THRWHITE.remove-dii-this> - 2011-04-27 15:37 +0000
            Re: JTextArea append meth "Tom Hawtin" <tom.hawtin@THRWHITE.remove-dii-this> - 2011-04-27 15:37 +0000
          Re: JTextArea append meth "Roedy Green" <roedy.green@THRWHITE.remove-dii-this> - 2011-04-27 15:37 +0000
        Re: JTextArea append meth "Lee Graba" <lee.graba@THRWHITE.remove-dii-this> - 2011-04-27 15:37 +0000
      Re: JTextArea append meth "Roedy Green" <roedy.green@THRWHITE.remove-dii-this> - 2011-04-27 15:37 +0000
      Re: JTextArea append meth "tar" <tar@THRWHITE.remove-dii-this> - 2011-04-27 15:37 +0000

csiph-web