Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package gerenciadoreslayout;
- import javax.swing.*;
- import java.awt.*;
- public class GerenciadoresLayout {
- public static void main(String[] args) {
- GerenciadoresLayout sistema = new GerenciadoresLayout();
- sistema.iniciar();
- }
- public void iniciar() {
- JFrame janela = new JFrame();
- JPanel painel = new JPanel();
- painel.setBackground(Color.darkGray);
- JButton east = new JButton("east");
- JButton west = new JButton("west");
- JButton north = new JButton("Nort");
- JButton south = new JButton("South");
- JButton center = new JButton("Center");
- JButton center1 = new JButton("center1");
- janela.getContentPane().add(BorderLayout.CENTER, painel);
- painel.add(center);
- painel.add(center1);
- janela.getContentPane().add(BorderLayout.WEST, west);
- janela.getContentPane().add(BorderLayout.NORTH, north);
- janela.getContentPane().add(BorderLayout.SOUTH, south);
- janela.getContentPane().add(BorderLayout.EAST, east);
- janela.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- janela.setSize(200,200);
- janela.setVisible(true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement