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 ...

+ Reply to Thread
Results 1 to 2 of 2

Emulating component operation

  1. Default 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

  2. Default 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.

+ Reply to Thread

Similar Threads

  1. Emulating position:fixed in IE6
    By Application Development in forum Javascript
    Replies: 1
    Last Post: 10-21-2007, 10:07 PM
  2. Replies: 2
    Last Post: 06-26-2007, 02:19 PM
  3. Emulating Up/Down In ListView Control
    By Application Development in forum DOTNET
    Replies: 0
    Last Post: 06-16-2007, 11:00 PM
  4. emulating the old VAX editor
    By Application Development in forum Editors
    Replies: 7
    Last Post: 07-01-2006, 09:19 PM
  5. Emulating the typewriter
    By Application Development in forum Java
    Replies: 4
    Last Post: 02-27-2006, 03:10 PM