Advertisement
Guest User

Untitled

a guest
Dec 17th, 2014
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.97 KB | None | 0 0
  1.  public class Interfaces {
  2.     public static void main(String[] args) {
  3.         JFrame v = new JFrame();
  4.         v.setLayout(new BorderLayout());
  5.         v.setBounds(100, 100, 450, 300);
  6. Hugo: import java.awt.BorderLayout;
  7. import java.awt.event.ActionEvent;
  8. import java.awt.event.ActionListener;
  9.  
  10. import javax.swing.*;
  11. import javax.swing.border.EmptyBorder;
  12.  
  13. public class Interfaces {
  14.     public static void main(String[] args) {
  15.         JFrame v = new JFrame();
  16.         v.setLayout(new BorderLayout());
  17.         v.setBounds(100, 100, 450, 300);
  18.        
  19.         JPanel panel = new JPanel();
  20.         v.add(panel, BorderLayout.SOUTH);
  21.         panel.setLayout(new BorderLayout(0, 0));
  22.        
  23.         JPanel panel_1 = new JPanel();
  24.         panel.add(panel_1, BorderLayout.EAST);
  25.         panel_1.setLayout(new BoxLayout(panel_1, BoxLayout.Y_AXIS));
  26.        
  27.         final JButton btnNewButton_3 = new JButton("New button");
  28.         panel_1.add(btnNewButton_3);
  29.        
  30.         JButton btnNewButton_4 = new JButton("New button");
  31.         panel_1.add(btnNewButton_4);
  32.        
  33.         JButton btnNewButton_2 = new JButton("New button");
  34.         panel_1.add(btnNewButton_2);
  35.        
  36.         JPanel panel_2 = new JPanel();
  37.         panel.add(panel_2, BorderLayout.WEST);
  38.        
  39.         JButton btnNewButton = new JButton("New button");
  40.         panel_2.add(btnNewButton);
  41.        
  42.         JButton btnNewButton_1 = new JButton("New button");
  43.         panel_2.add(btnNewButton_1);
  44.        
  45.        
  46.  
  47.        
  48.         btnNewButton_3.addActionListener(new ActionListener() {
  49.             public void actionPerformed(ActionEvent arg0) {
  50.                 //label1.setText("¡Adiós mundo!");
  51.                 //label1.setText(editorPane.getText());
  52.                 btnNewButton_3.setText(btnNewButton_3.getText()+"1");
  53.             }
  54.         });
  55.        
  56.        
  57.         v.pack();
  58.         v.setVisible(true);
  59.         v.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  60.     }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement