Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Threading problem between swing/swt
Threading problem between swing/swt [message #440122] Fri, 23 July 2004 11:27 Go to next message
Eclipse UserFriend
Originally posted by: sunay.yaldiz.gentleware.com

Hello,

I have a strange problem on threading, at least I guess it is because of
threading. In an Eclipse action, I am calling a method which shows (for
saving of a project)swing gui for asking "are you sure to overwrite "
etc and a progress bar for showing the status of saving. After showing
the window, it does not let the interaction with the window. I can not
answer as "yes" or "no" for example.

I tried to put the method call which shows swing gui in
display.asynchExec thinking it could help, but no help.

Display.asyncExec (new Runnable () {
public void run () { //this method shows swing gui and
progressdialog
myProject.save(filepath);
}
});

By the way, the save method also uses threads itself.(not sure if it is
related..)

What can I do, I am struggling with it since yesterday, but could not
find any solution.

Any help is appreciated,
Thanks
Sunay
Re: Threading problem between swing/swt [message #440123 is a reply to message #440122] Fri, 23 July 2004 12:48 Go to previous messageGo to next message
David Thomson is currently offline David ThomsonFriend
Messages: 65
Registered: July 2009
Member
Did you try putting it in a separate thread and running it *without*
Display.syncExec/Display.asyncExec? I have never tried running a Swing
GUI from SWT, but I have tried the other way around, and I always have
to put it in a separate thread or otherwise it will block the Swing
event thread from continuing. If you try that and it doesn't work, I'll
experiment myself and try to help.

David

Sunay Yaldiz wrote:
>
> Hello,
>
> I have a strange problem on threading, at least I guess it is because of
> threading. In an Eclipse action, I am calling a method which shows (for
> saving of a project)swing gui for asking "are you sure to overwrite "
> etc and a progress bar for showing the status of saving. After showing
> the window, it does not let the interaction with the window. I can not
> answer as "yes" or "no" for example.
>
> I tried to put the method call which shows swing gui in
> display.asynchExec thinking it could help, but no help.
>
> Display.asyncExec (new Runnable () {
> public void run () { //this
> method shows swing gui and progressdialog
> myProject.save(filepath);
> }
> });
>
> By the way, the save method also uses threads itself.(not sure if it is
> related..)
>
> What can I do, I am struggling with it since yesterday, but could not
> find any solution.
>
> Any help is appreciated,
> Thanks
> Sunay
Re: Threading problem between swing/swt [message #440124 is a reply to message #440123] Fri, 23 July 2004 14:59 Go to previous message
Eclipse UserFriend
Originally posted by: sunay.yaldiz.gentleware.com

Your suggestion worked. Thank you very much.
Best regards,
Sunay

David Thomson wrote:
> Did you try putting it in a separate thread and running it *without*
> Display.syncExec/Display.asyncExec? I have never tried running a Swing
> GUI from SWT, but I have tried the other way around, and I always have
> to put it in a separate thread or otherwise it will block the Swing
> event thread from continuing. If you try that and it doesn't work, I'll
> experiment myself and try to help.
>
> David
>
> Sunay Yaldiz wrote:
>
>>
>> Hello,
>>
>> I have a strange problem on threading, at least I guess it is because
>> of threading. In an Eclipse action, I am calling a method which shows
>> (for saving of a project)swing gui for asking "are you sure to
>> overwrite " etc and a progress bar for showing the status of saving.
>> After showing the window, it does not let the interaction with the
>> window. I can not answer as "yes" or "no" for example.
>>
>> I tried to put the method call which shows swing gui in
>> display.asynchExec thinking it could help, but no help.
>>
>> Display.asyncExec (new Runnable () {
>> public void run () { //this
>> method shows swing gui and progressdialog
>> myProject.save(filepath); }
>> });
>>
>> By the way, the save method also uses threads itself.(not sure if it
>> is related..)
>>
>> What can I do, I am struggling with it since yesterday, but could not
>> find any solution.
>>
>> Any help is appreciated,
>> Thanks
>> Sunay
Previous Topic:standalone SWT versus RCP
Next Topic:Text widget with small button inside
Goto Forum:
  


Current Time: Fri Apr 19 05:33:17 GMT 2024

Powered by FUDForum. Page generated in 0.02146 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top