Ver Mensaje Individual
  #4 (permalink)  
Antiguo 13/08/2015, 08:59
Avatar de Profesor_Falken
Profesor_Falken
 
Fecha de Ingreso: agosto-2014
Ubicación: Mountain View
Mensajes: 1.323
Antigüedad: 9 años, 9 meses
Puntos: 182
Respuesta: Crear botones con un array en Java

Buenas,

Tu codigo tiene multiples errores. Ni siquiera compila.

Deberia ser algo como esto:

Código Java:
Ver original
  1. char [] botones = {'A','B','C','D','E','F','G','H','I','J','K','L',' M','N','O','P','Q','R','S','T','U','V','W','X','Y' ,'Z'};
  2. JButton[] boton = new JButton[botones.length];
  3.  
  4. for(int i=0; i<botones.length; i++){
  5.     boton[i] = new JButton(botones[i]);
  6. }

Un saludo
__________________
If to err is human, then programmers are the most human of us