Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/12/2011, 11:40
fcosun
 
Fecha de Ingreso: octubre-2011
Mensajes: 153
Antigüedad: 12 años, 6 meses
Puntos: 7
Crear botones con While ?

Crear botones con While ?

Estoy creando botones masivos con un bucle no se si sera posible es solo por curiocidad y me da un error en la linea 16.


Código Java:
Ver original
  1. import javax.IO.*;
  2. import java.awt.*;
  3. import javax.swing.*;
  4.  
  5. public class prueba
  6. {
  7.     public static void main(String []args)
  8.     {
  9.  
  10.     JFrame frame = new JFrame("Prueba");
  11.  
  12.     int x = 1;
  13.  
  14.     while (x <= 10) {
  15.  
  16.         Jbutton miboton + x = new Jbutton();
  17.  
  18.         frame.add(miboton + x);
  19.  
  20.         x++;
  21.     }
  22.    
  23.     frame.setVisible(true);
  24.    
  25.     }
  26. }
__________________
Mi mail: [email protected]