Advertisement
Alfoli

Exemplayout

Feb 20th, 2020
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.01 KB | None | 0 0
  1. package Exemplayout;
  2. import java.awt.BorderLayout;
  3. import java.awt.GridLayout;
  4. import java.awt.FlowLayout;
  5. import javax.swing.JFrame;
  6. import javax.swing.JButton;
  7.  
  8. public class Exemplayout extends JFrame{
  9.     private JButton btnEsq = new JButton ("Esq");
  10.     private JButton btnDir = new JButton ("Dir");
  11.     private JButton btnCentro = new JButton ("Centro");
  12.     private JButton btnOeste = new JButton ("Oeste");
  13.     private JButton btnLeste = new JButton ("Leste");
  14.    
  15.     public Exemplayout (){
  16.         setLayout (new BorderLayout ());
  17.         add (btnEsq, BorderLayout.SOUTH);
  18.         add (btnCentro, BorderLayout.CENTER);
  19.         add (btnDir, BorderLayout.NORTH);
  20.         add (btnOeste, BorderLayout.WEST);
  21.         add (btnLeste, BorderLayout.EAST);
  22.        
  23.     }
  24. public static void main (String [] args){
  25.     Exemplayout tela = new Exemplayout();
  26.     tela.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
  27.     tela.setSize (300,100);
  28.     tela.setLocation (500,300);
  29.     tela.setVisible (true);
  30.  }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement