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:ToggleButtonCheckBoxRadioButton.java

public ToggleButtonCheckBoxRadioButton() {
    setSize(450, 350);/*from w w w .j  a v a 2  s. c om*/

    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    getContentPane().add(new TogglePanel(), BorderLayout.SOUTH);
}

From source file:Main.java

public Main() {
    JScrollPane talkPane = new JScrollPane(talkArea, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
            JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    JScrollPane inputPane = new JScrollPane(inputField, JScrollPane.VERTICAL_SCROLLBAR_NEVER,
            JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
    int gap = 10;
    setLayout(new BorderLayout(gap, gap));
    add(talkPane, BorderLayout.CENTER);
    add(inputPane, BorderLayout.SOUTH);
}

From source file:Test.java

public Test() {
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    d.getContentPane().add(new JLabel("Click the OK button"), BorderLayout.CENTER);
    JButton closeIt = new JButton("OK");
    closeIt.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            System.out.println("Closing dialog");
            d.dispose();/*  w ww.j  ava  2 s  .c  om*/
        }
    });
    d.getContentPane().add(closeIt, BorderLayout.SOUTH);
    d.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
    d.pack();

    getContentPane().add(new JLabel("Placeholder label"));
    pack();
    setSize(200, 200);
    setVisible(true);
    d.setVisible(true);
}

From source file:CombinedLayoutManager.java

public CombinedLayoutManager() {
    Container pane = getContentPane();
    pane.setLayout(new BorderLayout());
    pane.add(getHeader(), BorderLayout.NORTH);
    pane.add(getTextArea(), BorderLayout.CENTER);
    pane.add(getButtonPanel(), BorderLayout.SOUTH);
}

From source file:Main.java

void initUI() {
    JFrame frame = new JFrame(Main.class.getSimpleName());
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    textArea = new JTextArea(24, 80);
    save = new JButton("Save to file");
    save.addActionListener(e -> saveToFile());
    frame.add(new JScrollPane(textArea));
    JPanel buttonPanel = new JPanel();
    buttonPanel.add(save);//  ww w  .ja v a 2  s . co m
    frame.add(buttonPanel, BorderLayout.SOUTH);
    frame.setSize(500, 400);
    frame.setVisible(true);
}

From source file:Main.java

public Main() {
    setSize(450, 350);//from  w  ww.j ava 2 s.co  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:Main.java

@Override
public void run() {
    button = new JButton("Shake with this Button  ");
    button.addActionListener(new ActionListener() {
        @Override//  www .  j a v a2  s.  c  o  m
        public void actionPerformed(ActionEvent e) {
            shakeButton();
        }
    });
    JFrame frame = new JFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.add(button, BorderLayout.SOUTH);
    frame.setSize(240, 160);
    frame.setVisible(true);
}

From source file:ColorPicker.java

public ColorPicker() {
    super("JColorChooser Test Frame");
    setSize(200, 100);//from  w  ww .  ja va 2s  .c  o m
    final Container contentPane = getContentPane();
    final JButton go = new JButton("Show JColorChooser");
    go.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            Color c;
            c = JColorChooser.showDialog(((Component) e.getSource()).getParent(), "Demo", Color.blue);
            contentPane.setBackground(c);
        }
    });
    contentPane.add(go, BorderLayout.SOUTH);
    setDefaultCloseOperation(EXIT_ON_CLOSE);
}

From source file:Main.java

public Main() {
    textField.addActionListener(e -> {
        comboBox.addItem(textField.getText());
        textField.setText("");
        comboBox.showPopup();//from  w  ww  .j ava2  s . c o  m
    });

    JFrame frame = new JFrame();
    frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
    frame.add(comboBox, BorderLayout.SOUTH);
    frame.add(textField, BorderLayout.WEST);
    frame.add(new JLabel("Enter to add Item  "), BorderLayout.EAST);
    frame.pack();
    frame.setVisible(true);
}

From source file:Main.java

public Main() {
    JPanel textPanel = new JPanel();
    textPanel.setLayout(new BoxLayout(textPanel, BoxLayout.PAGE_AXIS));

    firstTextArea = new JTextArea(10, 50);
    secondTextArea = new JTextArea(10, 50);

    textPanel.add(new JScrollPane(firstTextArea));
    textPanel.add(new JScrollPane(secondTextArea));

    testFrame.add(textPanel, BorderLayout.CENTER);

    copyTextButton = new JButton("Copy text");
    copyTextButton.addActionListener(e -> copyText());
    testFrame.add(copyTextButton, BorderLayout.SOUTH);
}