Advertisement
Guest User

ReNcOoR

a guest
Nov 30th, 2010
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 2.17 KB | None | 0 0
  1. import java.awt.Dimension;
  2. import java.awt.Toolkit;
  3. import java.awt.event.ActionEvent;
  4. import java.awt.event.ActionListener;
  5.  
  6. import javax.swing.JButton;
  7. import javax.swing.JFrame;
  8. import javax.swing.JLabel;
  9. import javax.swing.JScrollPane;
  10. import javax.swing.JTextArea;
  11. import javax.swing.JTextField;
  12.  
  13.  
  14. public class lap2 extends JFrame implements ActionListener{
  15.    
  16.         private JTextField t, t1, t2, t3, t4, t5;
  17.         private JLabel l, l1, l2, l3, l4, l5;
  18.         private JButton boton;
  19.         private static int cont;
  20.         private static int cont2 = 0;
  21.         private laptop array[] = new laptop[cont];
  22.        
  23.        
  24.        
  25.         public lap2 (){
  26.            
  27.             super("Example_Class");
  28.             this.setSize(400, 400);
  29.             centrarventana();
  30.             this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  31.             this.setResizable(false);
  32.             this.setLayout(null);
  33.            
  34.             creargui();
  35.            
  36.            
  37.            
  38.            
  39.            
  40.            
  41.         }
  42.        
  43.         private void creargui (){
  44.            
  45.             t  = new JTextField();
  46.             t1 = new JTextField();
  47.             t2 = new JTextField();
  48.             t3 = new JTextField();
  49.             t4 = new JTextField();
  50.             t5 = new JTextField();
  51.            
  52.             l  = new JLabel("Objetos Creados");
  53.             l1 = new JLabel("Numero Objetos Laptop");
  54.             l2 = new JLabel("Marca");
  55.             l3 = new JLabel("Modelo");
  56.             l4 = new JLabel("Tamaño Memoria");
  57.             l5 = new JLabel("Precio");
  58.            
  59.             boton = new JButton("Listo");
  60.            
  61.             this.add(l);
  62.             l.setBounds(230, 100, 150, 20 );
  63.             this.add(t);
  64.             t.setBounds(260, 130, 40, 25);
  65.             this.add(l1);
  66.             l1.setBounds(10, 20, 150, 20);
  67.             this.add(t1);
  68.             t1.setBounds(10, 50, 70, 25);
  69.             this.add(l2);
  70.             l2.setBounds(10, 80, 100, 20);
  71.             this.add(t2);
  72.             t2.setBounds(10, 110, 150, 25);
  73.             this.add(l3);
  74.             l3.setBounds(10, 140, 100, 20);
  75.             this.add(t3);
  76.             t3.setBounds(10, 170, 150, 25);
  77.             this.add(l4);
  78.             l4.setBounds(10, 200, 100, 20);
  79.             this.add(t4);
  80.             t4.setBounds(10, 230, 150, 25);
  81.             this.add(l5);
  82.             l5.setBounds(10, 260, 100, 20);
  83.             this.add(t5);
  84.             t5.setBounds(10, 290, 150, 25);
  85.            
  86.             this.add(boton);
  87.             boton.setBounds(205, 220, 150, 30);
  88.             boton.addActionListener(this);
  89.                
  90.         }
  91.        
  92.         private void contenedor (){
  93.            
  94.             cont = Integer.parseInt(t1.getText());
  95.            
  96.             for (int i = 0; i < cont; i++){
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement