Jenis Layout Manager
1.Border Layout
2.Flow Layout
3.Grid Layout
4.Grid Bag Layout
5.Box Layout
6.Card Layout
BorderLayoutBeraksi.java
public class BorderLayoutBeraksi extends JFrame {
JButton nButton =
new JButton("North");
JButton sButton =
new JButton("South");
JButton eButton =
new JButton("East");
JButton wButton =
new JButton("West");
JButton cButton =
new JButton("Center");
JButton( Center );
public BorderLayoutBeraksi() {
super("Border Layout Beraksi"); setSize(240, 280);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLayout(new BorderLayout());
add(nButton, BorderLayout.NORTH);
add(sButton, BorderLayout.SOUTH);
add(eButton, BorderLayout.EAST);
add(wButton, BorderLayout.WEST);
add(cButton, BorderLayout.CENTER); }
public static void main(String[] args) {
BorderLayoutBeraksi frame = new
BorderLayoutBeraksi();
Frame.setVisible(true);
}
}
0 komentar:
Posting Komentar