Thread Problem... [message #437815] |
Wed, 05 October 2005 13:13 |
Eclipse User |
|
|
|
Originally posted by: gkurien.icope.com
i have opened a dialog box which have some Text box ...and i do some
operation when i click the OK button .
i use getter methods like "
public String getText1(){
return Text.getText();
}"
to retrieve the contents in the TextBox ...
but i cant use them once i get the control out of the DialogBox coz it
runs in a different thread...
so how do i still retrieve the values from the Text box...
if i store the contents of the Text box into a variable , i know i can
retrive it..but thats not a good practice i think..can u tell me wat my
other possibilities are ?
|
|
|
Re: Thread Problem... [message #437834 is a reply to message #437815] |
Wed, 05 October 2005 15:45 |
Eclipse User |
|
|
|
Originally posted by: Lamont_Gilbert.rigidsoftware.com
Genu George wrote:
>
> i have opened a dialog box which have some Text box ...and i do some
> operation when i click the OK button .
> i use getter methods like "
> public String getText1(){ return Text.getText();
> }" to retrieve the contents in the TextBox ...
>
> but i cant use them once i get the control out of the DialogBox coz it
> runs in a different thread...
>
> so how do i still retrieve the values from the Text box...
>
> if i store the contents of the Text box into a variable , i know i can
> retrive it..but thats not a good practice i think..can u tell me wat my
> other possibilities are ?
>
1. Have textbox store its values into a variable of the dialog while it
is being updated.
2. Have user of the value create a runnable that runs in the GUI thread
to read out the value of the textbox.
3. When OK is pressed have dialog copy all values from its gui items
into variables of the dialog that can be retrieved by calling methods on
the dialog. typically this is done in a 'close' method of the dialog or
something similar.
I prefer 3.
CL
|
|
|
Powered by
FUDForum. Page generated in 0.03208 seconds