Click here to Skip to main content
15,500,824 members
Home / Discussions / Java
   

Java

 
AnswerRe: cannot resolve Pin
Richard MacCutchan30-Mar-20 4:50
mveRichard MacCutchan30-Mar-20 4:50 
GeneralRe: cannot resolve Pin
MallardsReach30-Mar-20 7:29
MemberMallardsReach30-Mar-20 7:29 
GeneralRe: cannot resolve Pin
Richard MacCutchan30-Mar-20 7:45
mveRichard MacCutchan30-Mar-20 7:45 
GeneralRe: cannot resolve Pin
MallardsReach30-Mar-20 11:32
MemberMallardsReach30-Mar-20 11:32 
GeneralRe: cannot resolve Pin
Richard MacCutchan30-Mar-20 22:34
mveRichard MacCutchan30-Mar-20 22:34 
GeneralRe: cannot resolve Pin
Richard MacCutchan30-Mar-20 23:52
mveRichard MacCutchan30-Mar-20 23:52 
GeneralRe: cannot resolve Pin
MallardsReach31-Mar-20 0:22
MemberMallardsReach31-Mar-20 0:22 
QuestionRadio Button Selected Pin
MallardsReach25-Mar-20 10:50
MemberMallardsReach25-Mar-20 10:50 
Below is the code for 12 radiobuttons it compiles and runs but when I test out the first 2 buttons nothing happens. I have setActionCommand in the loop for each button so What is it I've not done?
Java
ButtonGroup bgTableButtons = new ButtonGroup();

    JRadioButton[] rbTable = new JRadioButton[13];

        int y = 20;
        for (int i = 1; i < rbTable.length; i++)
            {
                rbTable[i] = new JRadioButton(Integer.toString(i) + " Times");
                rbTable[i].setActionCommand(Integer.toString(i));
                rbTable[i].setBounds(320, y, 80, 20);
                bgTableButtons.add(rbTable[i]);
                panel.add(rbTable[i]);
                y = y + 20;
            } //End of for loop

if(rbTable[1].isSelected())
{
   userText.setText("Button 1");
}
else if(rbTable[2].isSelected())
{
    userText.setText("Button 2");
} // End of if

QuestionRe: Radio Button Selected Pin
ZurdoDev25-Mar-20 11:10
professionalZurdoDev25-Mar-20 11:10 
AnswerRe: Radio Button Selected Pin
MallardsReach25-Mar-20 11:33
MemberMallardsReach25-Mar-20 11:33 
QuestionRe: Radio Button Selected Pin
ZurdoDev25-Mar-20 11:39
professionalZurdoDev25-Mar-20 11:39 
AnswerRe: Radio Button Selected Pin
MallardsReach25-Mar-20 12:11
MemberMallardsReach25-Mar-20 12:11 
QuestionRe: Radio Button Selected Pin
ZurdoDev25-Mar-20 13:19
professionalZurdoDev25-Mar-20 13:19 
AnswerRe: Radio Button Selected Pin
Richard MacCutchan26-Mar-20 1:16
mveRichard MacCutchan26-Mar-20 1:16 
GeneralRe: Radio Button Selected Pin
MallardsReach26-Mar-20 1:28
MemberMallardsReach26-Mar-20 1:28 
GeneralRe: Radio Button Selected Pin
Richard MacCutchan26-Mar-20 1:36
mveRichard MacCutchan26-Mar-20 1:36 
GeneralRe: Radio Button Selected Pin
MallardsReach26-Mar-20 3:55
MemberMallardsReach26-Mar-20 3:55 
GeneralRe: Radio Button Selected Pin
MallardsReach26-Mar-20 5:15
MemberMallardsReach26-Mar-20 5:15 
QuestionUser defined Method Pin
MallardsReach24-Mar-20 3:56
MemberMallardsReach24-Mar-20 3:56 
AnswerRe: User defined Method Pin
Richard MacCutchan24-Mar-20 5:18
mveRichard MacCutchan24-Mar-20 5:18 
GeneralRe: User defined Method Pin
MallardsReach24-Mar-20 8:39
MemberMallardsReach24-Mar-20 8:39 
GeneralRe: User defined Method Pin
Richard MacCutchan24-Mar-20 8:44
mveRichard MacCutchan24-Mar-20 8:44 
GeneralRe: User defined Method Pin
MallardsReach24-Mar-20 9:29
MemberMallardsReach24-Mar-20 9:29 
GeneralRe: User defined Method Pin
Richard MacCutchan24-Mar-20 11:16
mveRichard MacCutchan24-Mar-20 11:16 
GeneralRe: User defined Method Pin
MallardsReach24-Mar-20 23:17
MemberMallardsReach24-Mar-20 23:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.