-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJCardLayout.java
More file actions
30 lines (27 loc) · 800 Bytes
/
Copy pathJCardLayout.java
File metadata and controls
30 lines (27 loc) · 800 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import javax.swing.*;
import java.awt.*;
public class JCardLayout extends JFrame
{
private JButton nb = new JButton("North Button");
private JButton sb = new JButton("South Button");
private JButton eb = new JButton("East Button");
private JButton wb = new JButton("West Button");
private JButton cb = new JButton("Center Button");
//private Container con = getContentPane();
public JCardLayout()
{
setLayout(new CardLayout());
add("nort", nb);
add("south",sb);
add("east",eb);
add("west",wb);
add("center",cb);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
public static void main(String[] args)
{
JCardLayout jbl = new JCardLayout();
jbl.setSize(250,250);
jbl.setVisible(true);
}
}