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() {
    JPanel panel = new JPanel();
    JLabel label = new JLabel("Number :");
    JFormattedTextField tf = new JFormattedTextField(NumberFormat.getIntegerInstance());

    tf.setColumns(10);/*  ww  w  . j a  v  a  2s .  c om*/
    panel.add(label);
    panel.add(tf);
    JButton button = new JButton("Click Me");
    panel.add(button);
    getContentPane().add(panel, BorderLayout.SOUTH);
    pack();
}

From source file:PasswordFieldEchoChar.java

public PasswordFieldEchoChar() {
    setSize(450, 350);//from w  ww  . ja v a2 s.c o  m

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

From source file:MainClass.java

    public SwingTest() {
  setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  JButton button = new JButton("Press me");
  button.addActionListener(new ButtonListener());
  this.getContentPane().setLayout(new BorderLayout());
  this.getContentPane().add(button, BorderLayout.SOUTH);
  this.getContentPane().add(field, BorderLayout.NORTH);
  this.pack();/*from ww w. j a v a2 s.  c o m*/
  this.setVisible(true);
}

From source file:Main.java

public Main() {
    Object[] items = { Color.red, Color.green, Color.blue };
    JComboBox comboBox = new JComboBox(items);
    comboBox.setRenderer(new ColorRenderer(comboBox));
    getContentPane().add(comboBox, BorderLayout.NORTH);
    add(new JTextField(), BorderLayout.SOUTH);
}

From source file:ToolBarwithCheckBox.java

public ToolBarwithCheckBox() {
    setSize(450, 350);/* w  w w.jav a 2s .c  o  m*/

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

From source file:ComboBoxWithItemChangedListener.java

public ComboBoxWithItemChangedListener() {
    setSize(450, 350);//from   w  w  w . j  a  v a 2  s.  co m

    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    getContentPane().add(new ComboPanel(), BorderLayout.SOUTH);
}

From source file:Main.java

public Main() {
    final AbstractTableModel model = new MyModel();
    final JTable table = new JTable(model);
    getContentPane().add(new JScrollPane(table), BorderLayout.CENTER);
    model.setValueAt(new Integer(1), 0, 0);

    JButton button = new JButton("Increment selected cell");
    getContentPane().add(button, BorderLayout.SOUTH);
    button.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            int row = table.getSelectedRow();
            int column = table.convertColumnIndexToModel(table.getSelectedColumn());
            int currentValue = ((Integer) model.getValueAt(row, column)).intValue();
            model.setValueAt(new Integer(currentValue + 1), row, column);
        }//from  www.  j a v a  2  s.  co  m
    });

    pack();
}

From source file:JWindowNoTitleBar.java

public JWindowNoTitleBar() {
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    window.getContentPane().add(new JLabel("About"), BorderLayout.NORTH);
    window.getContentPane().add(new JLabel("Label", SwingConstants.CENTER), BorderLayout.CENTER);
    JButton b = new JButton("Close");
    window.getContentPane().add(b, BorderLayout.SOUTH);
    b.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            window.setVisible(false);//from ww w .  ja v  a 2  s .c  o m
        }
    });
    window.pack();
    window.setBounds(50, 50, 200, 200);

    b = new JButton("About...");
    b.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            window.setVisible(true);
        }
    });
    getContentPane().add(b);
    pack();
}

From source file:SetValueAtToSetValue.java

public SetValueAtToSetValue() {
    final AbstractTableModel model = new MyModel();
    final JTable table = new JTable(model);
    getContentPane().add(new JScrollPane(table), BorderLayout.CENTER);
    model.setValueAt(new Integer(1), 0, 0);

    JButton button = new JButton("Increment selected cell");
    getContentPane().add(button, BorderLayout.SOUTH);
    button.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            int row = table.getSelectedRow();
            int column = table.convertColumnIndexToModel(table.getSelectedColumn());
            int currentValue = ((Integer) model.getValueAt(row, column)).intValue();
            model.setValueAt(new Integer(currentValue + 1), row, column);
        }//from  w  w w .  j ava  2 s  . co m
    });

    pack();
}

From source file:ButtonwithImageIcon.java

public ButtonwithImageIcon() {
    setSize(450, 350);//from  ww  w. j a  v  a2  s. co m

    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    getContentPane().add(new ButtonPanel(), BorderLayout.SOUTH);
}