Example usage for java.awt BorderLayout WEST

List of usage examples for java.awt BorderLayout WEST

Introduction

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

Prototype

String WEST

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

Click Source Link

Document

The west layout constraint (left side of container).

Usage

From source file:MainClass.java

public static void main(final String args[]) {
    JFrame frame = new JFrame("Popup JComboBox");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    frame.add(new BasicArrowButton(BasicArrowButton.NORTH), BorderLayout.NORTH);
    frame.add(new BasicArrowButton(BasicArrowButton.EAST), BorderLayout.EAST);
    frame.add(new BasicArrowButton(BasicArrowButton.SOUTH), BorderLayout.SOUTH);
    frame.add(new BasicArrowButton(BasicArrowButton.WEST), BorderLayout.WEST);
    frame.setSize(300, 200);/* w w  w . jav a  2s  .  com*/
    frame.setVisible(true);

}

From source file:SpinnerDateSample.java

public static void main(String args[]) {
    JFrame frame = new JFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    SpinnerModel model1 = new SpinnerDateModel();
    JSpinner spinner1 = new JSpinner(model1);

    JLabel label1 = new JLabel("Dates/Date");
    JPanel panel1 = new JPanel(new BorderLayout());
    panel1.add(label1, BorderLayout.WEST);
    panel1.add(spinner1, BorderLayout.CENTER);
    frame.add(panel1, BorderLayout.CENTER);

    frame.setSize(200, 90);/*from   w ww  . j  av a2 s .c om*/
    frame.setVisible(true);
}

From source file:MainClass.java

public static void main(final String args[]) {
    JFrame frame = new JFrame("JSpinner Dates");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    SpinnerModel model1 = new SpinnerDateModel();
    JSpinner spinner1 = new JSpinner(model1);
    JLabel label1 = new JLabel("All");
    JPanel panel1 = new JPanel(new BorderLayout());
    panel1.add(label1, BorderLayout.WEST);
    panel1.add(spinner1, BorderLayout.CENTER);
    frame.add(panel1, BorderLayout.NORTH);

    frame.setSize(200, 90);//  www  .ja va2 s. c om
    frame.setVisible(true);

}

From source file:Main.java

public static void main(String args[]) {
    JFrame frame = new JFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JPanel panel = new JPanel(new BorderLayout());

    JLabel label = new JLabel("Name: ");
    label.setDisplayedMnemonic(KeyEvent.VK_N);

    JTextField textField = new JTextField();
    label.setLabelFor(textField);/*ww  w . ja  va  2s.c  o  m*/

    panel.add(label, BorderLayout.WEST);
    panel.add(textField, BorderLayout.CENTER);
    frame.add(panel, BorderLayout.NORTH);
    frame.add(new JButton("Somewhere Else"), BorderLayout.SOUTH);
    frame.setSize(250, 150);
    frame.setVisible(true);
}

From source file:MainClass.java

public static void main(final String args[]) {
    JFrame frame = new JFrame("JSpinner Dates");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    SpinnerModel model1 = new SpinnerListModel();
    JSpinner spinner1 = new JSpinner(model1);
    JLabel label1 = new JLabel("None");
    JPanel panel1 = new JPanel(new BorderLayout());
    panel1.add(label1, BorderLayout.WEST);
    panel1.add(spinner1, BorderLayout.CENTER);
    frame.add(panel1, BorderLayout.NORTH);

    frame.setSize(200, 90);/*from  w ww . j  a  v a 2  s .  c o m*/
    frame.setVisible(true);

}

From source file:SpinnerNumberSample.java

public static void main(String args[]) {
    JFrame frame = new JFrame("JSpinner Sample");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    SpinnerModel model1 = new SpinnerNumberModel();
    JSpinner spinner1 = new JSpinner(model1);

    JLabel label1 = new JLabel("Numbers");
    JPanel panel1 = new JPanel(new BorderLayout());
    panel1.add(label1, BorderLayout.WEST);
    panel1.add(spinner1, BorderLayout.CENTER);
    frame.add(panel1, BorderLayout.SOUTH);

    frame.setSize(200, 90);//from  w ww.  j a  va  2s. c o  m
    frame.setVisible(true);
}

From source file:MainClass.java

public static void main(final String args[]) {
    JFrame frame = new JFrame("JSpinner Dates");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    SpinnerModel model3 = new SpinnerNumberModel();
    JSpinner spinner3 = new JSpinner(model3);

    JLabel label3 = new JLabel("Numbers");
    JPanel panel3 = new JPanel(new BorderLayout());
    panel3.add(label3, BorderLayout.WEST);
    panel3.add(spinner3, BorderLayout.CENTER);
    frame.add(panel3, BorderLayout.SOUTH);

    frame.setSize(200, 90);/*from  www .  j  av a  2  s  .  c om*/
    frame.setVisible(true);

}

From source file:Main.java

public static void main(String args[]) {
    JFrame frame = new JFrame("Label Focus Example");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JPanel panel = new JPanel(new BorderLayout());
    JLabel label = new JLabel("Name: ");
    label.setDisplayedMnemonic(KeyEvent.VK_N);
    JTextField textField = new JTextField();
    label.setLabelFor(textField);/*from   w  w  w. ja  v a  2 s .  co  m*/
    panel.add(label, BorderLayout.WEST);
    panel.add(textField, BorderLayout.CENTER);
    frame.add(panel, BorderLayout.NORTH);
    frame.add(new JButton("Somewhere Else"), BorderLayout.SOUTH);
    frame.setSize(250, 150);
    frame.setVisible(true);
}

From source file:Main.java

public static void main(String[] args) {
    JFrame frame = new JFrame("BorderLayout Test");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Container container = frame.getContentPane();

    // Add a button to each of the five areas of the BorderLayout
    container.add(new JButton("North"), BorderLayout.NORTH);
    container.add(new JButton("South"), BorderLayout.SOUTH);
    container.add(new JButton("East"), BorderLayout.EAST);
    container.add(new JButton("West"), BorderLayout.WEST);
    container.add(new JButton("Center"), BorderLayout.CENTER);

    frame.pack();/*from  www .  j av  a 2s .co m*/
    frame.setVisible(true);
}

From source file:Main.java

public static void main(String args[]) {
    JFrame frame = new JFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JPanel panel = new JPanel(new BorderLayout());
    JLabel label = new JLabel("Name: ");
    label.setDisplayedMnemonic(KeyEvent.VK_N);
    JTextField textField = new JTextField();
    textField.setHorizontalAlignment(JTextField.CENTER);

    label.setLabelFor(textField);/*  w ww. j a  v a 2s  .  c  o m*/
    panel.add(label, BorderLayout.WEST);
    panel.add(textField, BorderLayout.CENTER);
    frame.add(panel, BorderLayout.NORTH);
    frame.setSize(250, 150);
    frame.setVisible(true);

}