🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #745

Re: Threads not running together

#745
From: Owen Green
Date: Tue, 10 Dec 2002 00:16
20 lines
1715 bytes
"Werner Nussbaumer" <w.nussbaumer@datacomm.ch> wrote in message
news:3DF4E97F.A2137E96@datacomm.ch...
> Hi all
>
> I've got problems with threads not running together. Attached is the
> code I use.

There is a fundamental problem with this code, insofar as you're not
actually launching any new threads. Implementing Runnable and invoking
run() does not start a new thread - you need to create a new Thread
instance and invoke start().

Furthermore, one should not directly access GUI elements from threads
other than the Swing / AWT dispatch thread. Instead you can use
SwingUtilities.invokeAndWait() or invokeLater().

--
hth
Owen
Technical Details
Message-ID: <3df5327b@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!38.144.126.75.MISMATCH!feed1.newsreader.com!newsreader.com!rip!c03.atl99!news.webusenet.com!news02.tsnz.net!newsfeed01.tsnz.net!news.xtra.co.nz!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <3DF4E97F.A2137E96@datacomm.ch>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,1c1fc9c1a6ec4a62,start
X-Google-Attributes: gid1089d0,public
X-Google-ArrivalTime: 2002-12-09 16:32:25 PST
From: "Owen Green" <owen@begonefoulmachine.kennulz.demon.co.uk>
Newsgroups: borland.public.jbuilder.java.api
References: <3DF4E97F.A2137E96@datacomm.ch>
Subject: Re: Threads not running together
Date: Tue, 10 Dec 2002 00:16:17 -0000
Lines: 22
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
NNTP-Posting-Host: 62.253.133.242
Message-ID: <3df5327b@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1039479419 62.253.133.242 (9 Dec 2002 16:16:59 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!38.144.126.75.MISMATCH!feed1.newsreader.com!newsreader.com!rip!c03.atl99!news.webusenet.com!news02.tsnz.net!newsfeed01.tsnz.net!news.xtra.co.nz!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail