Solved

changing a for statement from checkboxs to buttons

Posted on 2004-04-10
3
204 Views
Last Modified: 2010-03-31
How could this be modified to work with buttons instead of checkboxs?


for(int i = 0; i < checkboxes.length; i++) {
     checkboxes[i].setName("kp" + (i + 1));
     checkboxes[i].setActionCommand("kp" + (i + 1) + ".wav");
     choices.add(checkboxes[i]);//go through checkboxs and add them to choices
}


Would it be this

for(int i = 0; i < buttons.length; i++) {
     buttons[i].setName("kp" + (i + 1));
     buttons[i].setActionCommand("kp" + (i + 1) + ".wav");
     choices.add(buttons[i]);//go through checkboxs and add them to choices
}

0
Comment
Question by:Drop_of_Rain
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 15

Accepted Solution

by:
Javatm earned 200 total points
ID: 10799118
Yes, I dont see any problems, just dont forget to declare JButton buttons, because
your codes will not work if its not declared.

Hope that helps . . .
Javatm
0
 

Author Comment

by:Drop_of_Rain
ID: 10799777
Thanks for the help and answer,
Christopher
0
 
LVL 15

Expert Comment

by:Javatm
ID: 10799894
http://javatm.4t.com

Always glad to help . . .
Friend : Javatm
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
The viewer will learn how to implement Singleton Design Pattern in Java.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question