Quisiera hacer una matriz de botones :huh: .. estoy utilizando netbeans ... alguien me puede ayudar plz
no es problema de saber utilizar una herramienta, es problema de lógica, conceptualización :silbar:
JButton botones[] = new JButton[40]; //tienes que iniciar CADA boton, ahi has declarado un "nuevo array de JButton"
//ahora hacemos que cada elemento del array sea un botón ;)
for(int i=0; i<40; i++)
botones[i] = new JButton();
salu2 :P
Me referia al momento de diseñar
(http://img36.imageshack.us/img36/9454/dibujokfx.jpg) (http://img36.imageshack.us/my.php?image=dibujokfx.jpg)
o weno talvez no sepa onde poner ese codigo :xD voy a tratar de ubicarlo
Citar
How Do I create an Array of GUI Controls in the NetBeans GUI Builder?
There is no IDE action dedicated to that. If the number of controls (the length of the array) is static, and you need the array only to loop over the controls, try this:
Add all components manually (via drag and drop). Then create an array in code and fill it with all the component variables.
http://wiki.netbeans.org/FaqGuiControlArray