In class1 I have a switch statement that switches on int choice and
defaults to choice = 1 when the program is run. In class2, I have
setup a GUI which includes 2 radio buttons. When someone clicks the
2nd radio button I want the variable that gets switched in class1 to
become 2 and restart the application with that value.
I'm having trouble getting Class1 to read-in the value when the radio
button is pushed and then restart. I'm new to programming so more
details would be useful.
Thanks!
Lew - 02 Nov 2007 15:31 GMT
> ... more details would be useful.
Likewise.
<http://www.physci.org/codes/sscce.html>

Signature
Lew
Roedy Green - 02 Nov 2007 19:30 GMT
On Fri, 02 Nov 2007 07:20:39 -0700, "DERosenblum@gmail.com"
<DERosenblum@gmail.com> wrote, quoted or indirectly quoted someone who
said :
> When someone clicks the
>2nd radio button I want the variable that gets switched in class1 to
>become 2 and restart the application with that value.
You want a to write a method of class1 that accepts a boolean.
public setZeugmaState( boolean on )
{
// code to poke the class1 gui the way you want.
// code to invoke the computations based on the change.
}
In your class2 event handler, call setZeugmaState( ... )
Zeugma here stands for the name of the property you seem reluctant to
divulge.
I can't fill in variable names because you did not divulge them.

Signature
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
Suffocate - 03 Nov 2007 10:42 GMT
On Nov 3, 12:20 am, "DERosenb...@gmail.com" <DERosenb...@gmail.com>
wrote:
> In class1 I have a switch statement that switches on int choice and
> defaults to choice = 1 when the program is run. In class2, I have
> setup a GUI which includes 2 radio buttons. When someone clicks the
> 2nd radio button I want the variable that gets switched in class1 to
> become 2 and restart the application with that value.
Depending on exactly how your app is structured, you could create a
Listener for class2, have class1 listen for specific events and pass
back the value that 'choice' should be set to.
/J.