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 07:27 Go to next message
Eclipse User
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 08:48 Go to previous messageGo to next message
David Thomson is currently offline David Thomson
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 10:59 Go to previous message
Eclipse User
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: Thu Apr 24 11:37:11 EDT 2014

Powered by FUDForum. Page generated in 0.04618 seconds