Professional Documents
Culture Documents
Vec
Vec
*/ /** * * @author Carlos */ import java.io.*; import javax.swing.*; public class ele extends JFrame { JButton arreglo[]=new JButton[20]; JTextField arreglo2[]=new JTextField[20]; JLabel la1,la2; int x1=0; int y=33; int y1=10; int x3=0; int y2=10; public ele(){ this.setTitle("elevador"); setLocationRelativeTo(null); setLayout(null); for(int i=0;i<20;i++){ arreglo[i]=new JButton(); arreglo[i].setVisible(true); arreglo[i].setBounds(0,y1, 40, 30); add(arreglo[i]); y1=y+y1; arreglo2[i]=new JTextField(""); arreglo2[i].setVisible(true); arreglo2[i].setBounds(40, y2, 30, 30); add(arreglo2[i]); y2=y+y2; }
} public static void main(String af[]){ ele c=new ele(); c.setVisible(true); c.setSize(100,800); c. setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } }