Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > SWT and threads

Reply
Thread Tools

SWT and threads

 
 
bilbo
Guest
Posts: n/a
 
      04-14-2005
Hi there.

I have a SWT application and would like to use threads (for a ticking clock
for instance). However, I see that SWT package doesn't have Swing's timer,
or SwingUtilities for invoking Runnable objects.

How is this achieved in SWT and is it even possible, or I need to revert
back to Swing? Thanks.


 
Reply With Quote
 
 
 
 
Marcin Grunwald
Guest
Posts: n/a
 
      04-15-2005
bilbo wrote:

> Hi there.
>
> I have a SWT application and would like to use threads (for a ticking
> clock for instance). However, I see that SWT package doesn't have Swing's
> timer, or SwingUtilities for invoking Runnable objects.
>
> How is this achieved in SWT and is it even possible, or I need to revert
> back to Swing? Thanks.


You can do with threads what you want, there aren't any limitations.
Just implement Runnable interface and start it.
If you want to access any SWT components from your thread you have to do it
using for example:

org.eclipse.swt.widgets.Display.getDefault().syncE xec(Runnable runnable);

check also:
Display.getCurrent()
Display.asyncExec(Runnable runnable)

--
Cheers
grundig
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Where can I download SWT? (SWT homepage) Ramon F Herrera Java 11 12-06-2007 03:18 AM
[new to threads] threads with UI and loop Une bévue Ruby 0 06-14-2006 10:22 AM
swt drag and drop to native? soni29 Java 0 12-24-2003 03:14 PM
SWT and Python (was: Re: What GUI toolkit looks the best?) Oren Tirosh Python 6 12-18-2003 02:13 AM
SWT and public fields Dave Benjamin Java 0 12-17-2003 07:23 AM



Advertisments