LaCaraDeLaVerga

tablero 2.0 Jbutton array bitches....

Aug 29th, 2016
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 4.07 KB | None | 0 0
  1. package presentacion;
  2.  
  3. import java.awt.EventQueue;
  4.  
  5. import javax.swing.JFrame;
  6. import javax.swing.JButton;
  7. import javax.swing.JLabel;
  8. import javax.swing.JTextField;
  9. import java.awt.Color;
  10.  
  11. public class multiTab {
  12.  
  13.     private JFrame frame;
  14.     private JTextField textField;
  15.  
  16.     /**
  17.      * Launch the application.
  18.      */
  19.     public static void main(String[] args) {
  20.         EventQueue.invokeLater(new Runnable() {
  21.             public void run() {
  22.                 try {
  23.                     multiTab window = new multiTab();
  24.                     window.frame.setVisible(true);
  25.                 } catch (Exception e) {
  26.                     e.printStackTrace();
  27.                 }
  28.             }
  29.         });
  30.     }
  31.  
  32.     /**
  33.      * Create the application.
  34.      */
  35.     public multiTab() {
  36.         initialize();
  37.     }
  38.  
  39.     /**
  40.      * Initialize the contents of the frame.
  41.      */
  42.     private void initialize() {
  43.         frame = new JFrame();
  44.         frame.getContentPane().setBackground(new Color(0, 128, 0));
  45.         frame.setBounds(100, 100, 450, 300);
  46.         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  47.         frame.getContentPane().setLayout(null);
  48.        
  49.        
  50.        
  51.        
  52.         //a continuaciΓ³n una lista de botones enumerados por indice , en los cual lo que esta entre comillas es el contenido que se va a mostrar
  53.         // EJ : "putitos"
  54.        
  55.         // el usuario no podra ingresar los valores que se les cante del orto poner en cada tablero como la otra version
  56.        
  57.         // se ve mas fachera
  58.        
  59.         //hay que poner un set en putitos con los valores
  60.        
  61.         // hay que ponerle un ciclo
  62.        
  63.         JButton btnNewButton_0 = new JButton("putitos");
  64.         btnNewButton_0.setBounds(10, 10, 50, 50);
  65.         frame.getContentPane().add(btnNewButton_0);
  66.        
  67.         JButton btnNewButton_1 = new JButton("New button");
  68.         btnNewButton_1.setBounds(10, 70, 50, 50);
  69.         frame.getContentPane().add(btnNewButton_1);
  70.        
  71.         JButton btnNewButton_2 = new JButton("New button");
  72.         btnNewButton_2.setBounds(10, 130, 50, 50);
  73.         frame.getContentPane().add(btnNewButton_2);
  74.        
  75.         JButton btnNewButton_3 = new JButton("New button");
  76.         btnNewButton_3.setBounds(10, 190, 50, 50);
  77.         frame.getContentPane().add(btnNewButton_3);
  78.        
  79.         JButton btnNewButton_4 = new JButton("New button");
  80.         btnNewButton_4.setBounds(70, 10, 50, 50);
  81.         frame.getContentPane().add(btnNewButton_4);
  82.        
  83.         JButton btnNewButton_5 = new JButton("New button");
  84.         btnNewButton_5.setBounds(70, 70, 50, 50);
  85.         frame.getContentPane().add(btnNewButton_5);
  86.        
  87.         JButton button = new JButton("50");
  88.         button.setBounds(70, 130, 50, 50);
  89.         frame.getContentPane().add(button);
  90.        
  91.         JButton btnNewButton_6 = new JButton("New button");
  92.         btnNewButton_6.setBounds(70, 190, 50, 50);
  93.         frame.getContentPane().add(btnNewButton_6);
  94.        
  95.         JButton button_1 = new JButton("");
  96.         button_1.setBounds(130, 10, 50, 50);
  97.         frame.getContentPane().add(button_1);
  98.        
  99.         JButton btnNewButton_7 = new JButton("New button");
  100.         btnNewButton_7.setBounds(130, 70, 50, 50);
  101.         frame.getContentPane().add(btnNewButton_7);
  102.        
  103.         JButton button_2 = new JButton("50");
  104.         button_2.setBounds(130, 130, 50, 50);
  105.         frame.getContentPane().add(button_2);
  106.        
  107.         JButton btnNewButton_8 = new JButton("New button");
  108.         btnNewButton_8.setBounds(130, 190, 50, 50);
  109.         frame.getContentPane().add(btnNewButton_8);
  110.        
  111.         JButton btnNewButton_9 = new JButton("New button");
  112.         btnNewButton_9.setBounds(190, 10, 50, 50);
  113.         frame.getContentPane().add(btnNewButton_9);
  114.        
  115.         JButton button_3 = new JButton("50");
  116.         button_3.setBounds(190, 70, 50, 50);
  117.         frame.getContentPane().add(button_3);
  118.        
  119.         JButton button_4 = new JButton("50");
  120.         button_4.setBounds(190, 130, 50, 50);
  121.         frame.getContentPane().add(button_4);
  122.        
  123.         JButton btnNewButton_10 = new JButton("New button");
  124.         btnNewButton_10.setBounds(186, 190, 50, 50);
  125.         frame.getContentPane().add(btnNewButton_10);
  126.        
  127.         JLabel label = new JLabel("2048");
  128.         label.setBounds(316, 40, 46, 14);
  129.         frame.getContentPane().add(label);
  130.        
  131.         JLabel lblIngreseSuNombre = new JLabel("ingrese su nombre :");
  132.         lblIngreseSuNombre.setBounds(281, 106, 127, 14);
  133.         frame.getContentPane().add(lblIngreseSuNombre);
  134.        
  135.         textField = new JTextField();
  136.         textField.setBounds(281, 130, 117, 20);
  137.         frame.getContentPane().add(textField);
  138.         textField.setColumns(10);
  139.     }
  140. }
Advertisement
Add Comment
Please, Sign In to add comment