Example usage for java.awt BorderLayout EAST

List of usage examples for java.awt BorderLayout EAST

Introduction

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

Prototype

String EAST

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

Click Source Link

Document

The east layout constraint (right side of container).

Usage

From source file:MainClass.java

public static void main(String args[]) {
    JFrame f = new JFrame("JToggleButton Sample");
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.add(new JToggleButton("North"), BorderLayout.NORTH);
    f.add(new JToggleButton("East"), BorderLayout.EAST);
    f.add(new JToggleButton("West"), BorderLayout.WEST);
    f.add(new JToggleButton("Center"), BorderLayout.CENTER);
    f.add(new JToggleButton("South"), BorderLayout.SOUTH);
    f.setSize(300, 200);/*ww w. ja  v a2 s  . co m*/
    f.setVisible(true);
}

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);//from   ww  w.  ja va2 s . c om
    frame.setVisible(true);

}

From source file:ToggleButtonSample.java

public static void main(String args[]) {
    JFrame f = new JFrame("JToggleButton Sample");
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Container content = f.getContentPane();
    content.add(new JToggleButton("North"), BorderLayout.NORTH);
    content.add(new JToggleButton("East"), BorderLayout.EAST);
    content.add(new JToggleButton("West"), BorderLayout.WEST);
    content.add(new JToggleButton("Center"), BorderLayout.CENTER);
    content.add(new JToggleButton("South"), BorderLayout.SOUTH);
    f.setSize(300, 200);/*from www .j av  a2  s. c  o  m*/
    f.setVisible(true);
}

From source file:DoubleColor.java

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

    JColorChooser left = new JColorChooser();
    left.setDragEnabled(true);/*from  w ww  . j  a  va  2s  .  co  m*/
    frame.add(left, BorderLayout.WEST);
    JColorChooser right = new JColorChooser();
    right.setDragEnabled(true);
    frame.add(right, BorderLayout.EAST);

    frame.pack();
    frame.setVisible(true);
}

From source file:MainClass.java

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

    JColorChooser left = new JColorChooser();
    left.setDragEnabled(true);//  w  w w .  j a  v a  2 s.c  om
    frame.add(left, BorderLayout.WEST);

    JColorChooser right = new JColorChooser();
    right.setDragEnabled(true);
    frame.add(right, BorderLayout.EAST);

    frame.pack();
    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();// ww  w. j  av  a2 s.c  om
    frame.setVisible(true);
}

From source file:Main.java

public static void main(String[] args) {
    JFrame frame = new JFrame("Testing");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    TestPane center = new TestPane(100, 100);
    frame.add(center);//w w  w. j  av  a2  s.c  om
    frame.add(new TestPane(100, 50), BorderLayout.NORTH);
    frame.add(new TestPane(100, 50), BorderLayout.SOUTH);
    frame.add(new TestPane(50, 100), BorderLayout.EAST);
    frame.add(new TestPane(50, 100), BorderLayout.WEST);

    System.out.println("Size beofre pack = " + frame.getSize() + "; " + center.getSize());

    frame.pack();

    System.out.println("Size after pack = " + frame.getSize() + "; " + center.getSize());

    frame.setLocationRelativeTo(null);
    frame.setVisible(true);
}

From source file:Main.java

public static void main(String[] args) {
    JFrame frame = new JFrame("test");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JPanel panel = new JPanel(new BorderLayout());
    JPanel panel2 = new JPanel(new BorderLayout());
    panel2.add(new JButton("NORTH"), BorderLayout.NORTH);
    panel2.add(new JButton("CENTER"));
    panel.add(panel2);//from  w w w. j  a v a2s .  com
    panel.add(new JButton("SOUTH"), BorderLayout.SOUTH);
    panel.add(new JButton("EAST"), BorderLayout.EAST);
    frame.add(panel);
    frame.pack();
    frame.setVisible(true);
}

From source file:MainClass.java

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

    Box box = Box.createHorizontalBox();

    JTree tree1 = new JTree();
    JScrollPane scrollPane1 = new JScrollPane(tree1);
    tree1.setAutoscrolls(true);/*from   ww  w .j a  va 2s . c o  m*/

    JTree tree2 = new JTree();
    tree2.putClientProperty("JTree.lineStyle", "None");
    JScrollPane scrollPane2 = new JScrollPane(tree2);

    box.add(scrollPane1, BorderLayout.WEST);
    box.add(scrollPane2, BorderLayout.EAST);

    frame.add(box, BorderLayout.CENTER);
    frame.setSize(300, 240);
    frame.setVisible(true);
}

From source file:Main.java

public static void main(String[] args) {
    JLabel label = new JLabel("java2s.com");

    JFrame frame = new JFrame("Testing");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setLayout(new BorderLayout());
    frame.add(label);/*from   ww w.jav  a  2 s .  c  o  m*/

    JPanel buttons = new JPanel(new GridLayout(0, 1));
    for (int index = 0; index < 10; index++) {
        buttons.add(new JButton(String.valueOf(index)));
    }

    JPanel right = new JPanel(new BorderLayout());
    right.add(buttons, BorderLayout.NORTH);
    frame.add(right, BorderLayout.EAST);

    frame.pack();
    frame.setLocationRelativeTo(null);
    frame.setVisible(true);
}