Advertisement
Guest User

Untitled

a guest
Jan 20th, 2020
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. package project1;
  2.  
  3. import java.awt.Dimension;
  4. import java.awt.Rectangle;
  5. import javax.swing.JButton;
  6. import javax.swing.JFrame;
  7.  
  8. public class Frame1 extends JFrame {
  9. private JButton Boton1 = new JButton();
  10. private JButton Boton2 = new JButton();
  11.  
  12. public Frame1() {
  13. try {
  14. Initialize();
  15. } catch (Exception e) {
  16. e.printStackTrace();
  17. }
  18. }
  19.  
  20. private void Initialize() throws Exception {
  21. this.getContentPane().setLayout( null );
  22. this.setSize(new Dimension(430, 344));
  23. Boton1.setText("Boton1");
  24. Boton1.setBounds(new Rectangle(70, 75, 71, 23));
  25. Boton2.setText("Boton2");
  26. Boton2.setBounds(new Rectangle(100, 65, 71, 23));
  27. this.getContentPane().add(Boton2, null);
  28. this.getContentPane().add(Boton1, null);
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement