101 |
public ComboBoxDemo(String title) |
public ComboBoxDemo(String title) |
102 |
{ |
{ |
103 |
super(title); |
super(title); |
104 |
getContentPane().add(createContent()); |
JPanel content = createContent(); |
105 |
|
JPanel closePanel = new JPanel(); |
106 |
|
JButton closeButton = new JButton("Close"); |
107 |
|
closeButton.setActionCommand("CLOSE"); |
108 |
|
closeButton.addActionListener(this); |
109 |
|
closePanel.add(closeButton); |
110 |
|
content.add(closePanel, BorderLayout.SOUTH); |
111 |
|
getContentPane().add(content); |
112 |
} |
} |
113 |
|
|
114 |
|
/** |
115 |
|
* Returns a panel with the demo content. The panel |
116 |
|
* uses a BorderLayout(), and the BorderLayout.SOUTH area |
117 |
|
* is empty, to allow callers to add controls to the |
118 |
|
* bottom of the panel if they want to (a close button is |
119 |
|
* added if this demo is being run as a standalone demo). |
120 |
|
*/ |
121 |
JPanel createContent() |
JPanel createContent() |
122 |
{ |
{ |
123 |
JPanel content = new JPanel(new BorderLayout()); |
JPanel content = new JPanel(new BorderLayout()); |
129 |
panel.add(createPanel5()); |
panel.add(createPanel5()); |
130 |
panel.add(createPanel6()); |
panel.add(createPanel6()); |
131 |
content.add(panel); |
content.add(panel); |
|
JPanel closePanel = new JPanel(); |
|
|
JButton closeButton = new JButton("Close"); |
|
|
closeButton.setActionCommand("CLOSE"); |
|
|
closeButton.addActionListener(this); |
|
|
closePanel.add(closeButton); |
|
|
content.add(closePanel, BorderLayout.SOUTH); |
|
132 |
return content; |
return content; |
133 |
} |
} |
134 |
|
|