Emulating component operation - Java
This is a discussion on Emulating component operation - Java ; Hello.
Excuse my poor English.
I have a stupid program that has a three JRadioButton named R, G, and B.
When it is launched, no button is selected. Window is made of one JPanel.
First time, the JPanel's background color ...
-
Emulating component operation
Hello.
Excuse my poor English.
I have a stupid program that has a three JRadioButton named R, G, and B.
When it is launched, no button is selected. Window is made of one JPanel.
First time, the JPanel's background color is default.
Next, when R button is selected, the background color of the JPanel turns into
red, when G is selected the color turns into green, and when Y, Yellow.
For such a program, normal requirements are that one JRadioButton is selected
when it is launched and that there is at least one another feedback of button
selection (e.g. background color).
My stupid program does not meet these requirement. But if there is a way to
emulate JRadioButton's clicking from code, I can meet them.
Is there such a way?
Am I thinking in a wrong way?
Thank you in advance.
///Hiroki Horiuchi
-
Re: Emulating component operation
Kiwi wrote:
> Hello.
>
> Excuse my poor English.
>
> I have a stupid program that has a three JRadioButton named R, G, and B.
> When it is launched, no button is selected. Window is made of one JPanel.
> First time, the JPanel's background color is default.
>
> Next, when R button is selected, the background color of the JPanel turns into
> red, when G is selected the color turns into green, and when Y, Yellow.
>
> For such a program, normal requirements are that one JRadioButton is selected
> when it is launched and that there is at least one another feedback of button
> selection (e.g. background color).
>
> My stupid program does not meet these requirement. But if there is a way to
> emulate JRadioButton's clicking from code, I can meet them.
>
See AbstractButton.setSelected() or AbstractButton.doClick() in the
javadoc. (Note that JRadioButton extends AbstractButton.)
HTH,
Ray
--
XML is the programmer's duct tape.
Similar Threads
-
By Application Development in forum Javascript
Replies: 1
Last Post: 10-21-2007, 10:07 PM
-
By Application Development in forum Microsoft Money
Replies: 2
Last Post: 06-26-2007, 02:19 PM
-
By Application Development in forum DOTNET
Replies: 0
Last Post: 06-16-2007, 11:00 PM
-
By Application Development in forum Editors
Replies: 7
Last Post: 07-01-2006, 09:19 PM
-
By Application Development in forum Java
Replies: 4
Last Post: 02-27-2006, 03:10 PM