Button creation
WaldoDTD
Posts: 142
Hey,
I am trying to create a GUI for my robot applications and I was wondering if there is a way to create a series of buttons based off of the size of an arraylist? It would be something like
while(index != arraylist.getSize()){
JButton J1 = JButton("");
}
I need to know as while the loop completes is it possible to increment the number to J1, J2, J3 etc....
I know this is for Javelin stamp but I have no idea where to post this.-signol01
I am trying to create a GUI for my robot applications and I was wondering if there is a way to create a series of buttons based off of the size of an arraylist? It would be something like
while(index != arraylist.getSize()){
JButton J1 = JButton("");
}
I need to know as while the loop completes is it possible to increment the number to J1, J2, J3 etc....
I know this is for Javelin stamp but I have no idea where to post this.-signol01
Comments
Perhaps this:
int size;
JButton[noparse]/noparse jb = new JButton[noparse][[/noparse]size]; //create array of Button
for (i=0; i<size; i++) { //initialize each entry
· jb[noparse][[/noparse]i] = new JButton("");
}
regards peter