BorderLayout.WEST : BorderLayout « java.awt « Java by API






BorderLayout.WEST

 
import java.awt.BorderLayout;

import javax.swing.JFrame;
import javax.swing.JToggleButton;

public class MainClass {
  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);
    f.setVisible(true);
  }
}

           
         
  








Related examples in the same category

1.BorderLayout.BEFORE_FIRST_LINE
2.BorderLayout.BEFORE_LINE_BEGINS
3.BorderLayout.CENTER
4.BorderLayout.EAST
5.BorderLayout.NORTH
6.BorderLayout.SOUTH
7.new BorderLayout()