Example usage for java.awt BorderLayout SOUTH

List of usage examples for java.awt BorderLayout SOUTH

Introduction

In this page you can find the example usage for java.awt BorderLayout SOUTH.

Prototype

String SOUTH

To view the source code for java.awt BorderLayout SOUTH.

Click Source Link

Document

The south layout constraint (bottom of container).

Usage

From source file:Main.java

public Main() {
    this.setSize(300, 300);
    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    JPanel picPanel = new PicturePanel();
    this.add(picPanel, BorderLayout.CENTER);

    JPanel buttonPanel = new JPanel();
    getPictureButton.addActionListener(this);
    buttonPanel.add(getPictureButton);//  w  w  w  . j a v a  2  s .c o  m
    this.add(buttonPanel, BorderLayout.SOUTH);

    this.setVisible(true);
}

From source file:Box2.java

public void init() {
    Box bv = Box.createVerticalBox();
    for (int i = 0; i < 5; i++) {
        bv.add(new JButton("bv " + i));
        bv.add(Box.createVerticalStrut(i * 10));
    }/*from   w  ww.  ja va  2 s .c  o  m*/
    Box bh = Box.createHorizontalBox();
    for (int i = 0; i < 5; i++) {
        bh.add(new JButton("bh " + i));
        bh.add(Box.createHorizontalStrut(i * 10));
    }
    Container cp = getContentPane();
    cp.add(BorderLayout.EAST, bv);
    cp.add(BorderLayout.SOUTH, bh);
}

From source file:Main.java

public Main() {
        super();/* w ww.  j a  v a 2  s .c om*/
        JButton closeButton = new JButton("Close");
        this.setDefaultCloseOperation(EXIT_ON_CLOSE);
        this.setUndecorated(true);
        this.setOpacity(0.80f);
        this.setSize(200, 200);
        // Center it on the screen
        this.setLocationRelativeTo(null);
        this.add(closeButton, BorderLayout.SOUTH);
        closeButton.addActionListener(e -> System.exit(0));
    }

From source file:TabPanelwithImageIconCustom.java

public TabPanelwithImageIconCustom() {
    setSize(450, 350);/*from   w  w  w .  j  a v  a  2 s .  c  o  m*/
    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    getContentPane().add(textfield, BorderLayout.SOUTH);

    JMenuBar mbar = new JMenuBar();
    JMenu menu = new JMenu("File");
    menu.add(new JCheckBoxMenuItem("Check Me"));
    menu.addSeparator();
    JMenuItem item = new JMenuItem("Exit");
    item.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            System.exit(0);
        }
    });
    menu.add(item);
    mbar.add(menu);
    setJMenuBar(mbar);

    JTabbedPane tabbedPane = new JTabbedPane();

    tabbedPane.addTab("Button", new TabIcon(), new JButton(""), "Click here for Button demo");
}

From source file:MonthPanel.java

public MonthPanel(int month, int year) {
    this.month = month;
    this.year = year;
    JPanel monthPanel = new JPanel(true);
    monthPanel.setLayout(new BorderLayout());
    monthPanel.add(createTitleGUI(), BorderLayout.NORTH);
    monthPanel.add(createDaysGUI(), BorderLayout.SOUTH);
    this.add(monthPanel);
}

From source file:Main.java

public Main() {
    setSize(400, 300);//from   w ww  . ja  va 2 s .  c  om
    cardPanel.setLayout(cardLayout);
    jp1.add(jl1);
    jp2.add(jl2);
    cardPanel.add(jp1, "1");
    cardPanel.add(jp2, "2");

    btn1.addActionListener(e -> cardLayout.show(cardPanel, "1"));
    btn2.addActionListener(e -> cardLayout.show(cardPanel, "2"));
    buttonPanel.add(btn1);
    buttonPanel.add(btn2);
    add(cardPanel, BorderLayout.NORTH);
    add(buttonPanel, BorderLayout.SOUTH);
}

From source file:FileChooserTest.java

public FileChooserTest() {
    JPanel p = new JPanel();
    open.addActionListener(new OpenL());
    p.add(open);/*from   www.ja  v  a2s  .c  om*/
    save.addActionListener(new SaveL());
    p.add(save);
    Container cp = getContentPane();
    cp.add(p, BorderLayout.SOUTH);
    dir.setEditable(false);
    filename.setEditable(false);
    p = new JPanel();
    p.setLayout(new GridLayout(2, 1));
    p.add(filename);
    p.add(dir);
    cp.add(p, BorderLayout.NORTH);
}

From source file:Main.java

Main() {
    setSize(500, 300);//from  w  w  w. j a  v a 2s  . c om
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setLayout(new BorderLayout());
    JScrollPane pane = new JScrollPane();
    txtMain = new JTextArea();
    pane.setViewportView(txtMain);
    this.add(pane, BorderLayout.CENTER);

    JButton btnAddText = new JButton("Add Text");
    btnAddText.addActionListener(e -> {
        txtMain.setText(txtMain.getText()
                + "\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi sagittis id nibh vel rhoncus. ");
        String text = txtMain.getText();
        txtMain.setCaretPosition(text != null ? text.length() : 0);
    });
    add(btnAddText, BorderLayout.SOUTH);
    setVisible(true);
}

From source file:ImageFileFilterImageScale.java

public ImageFileFilterImageScale() {
    this.setSize(300, 300);
    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    JPanel picPanel = new PicturePanel();
    this.add(picPanel, BorderLayout.CENTER);

    JPanel buttonPanel = new JPanel();
    getPictureButton.addActionListener(this);
    buttonPanel.add(getPictureButton);//w  w w  .  j a  v  a  2  s  .  c om
    this.add(buttonPanel, BorderLayout.SOUTH);

    this.setVisible(true);
}

From source file:Main.java

public Main() {
    final JPopupMenu contextMenu = new JPopupMenu("Edit");
    contextMenu.add(makeMenuItem("Save"));
    contextMenu.add(makeMenuItem("Save As"));
    contextMenu.add(makeMenuItem("Close"));

    JFrame frame = new JFrame();
    JPanel panel = new JPanel();
    panel.setLayout(new BorderLayout());
    frame.add(panel);//from   w w w .j  av  a  2 s  . c om
    panel.setComponentPopupMenu(contextMenu);

    textArea.setInheritsPopupMenu(true);
    panel.add(BorderLayout.CENTER, textArea);

    JTextField textField = new JTextField();
    textField.setInheritsPopupMenu(true);
    panel.add(BorderLayout.SOUTH, textField);

    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setSize(400, 200);
    frame.setVisible(true);
}