|
 |
|
|
|
 |
/**
*Creating a JButton is just as simple as creating a JLabel
*or JPanel.
*/
// Creates a Content Pane for the button layout.
Container content = getContentPane();
// Creates a new button with the text “Button”.
JButton button = new JButton(“Button”);
content.add(button);
// Creates a new button with the text “Second Button”.
JButton button2 = new JButton(“Second Button”);
content.add(button2);
// Creates a new button with the text “Third Button”.
JButton button3 = new JButton(“Third Button”);
content.add(button3);
|
| |
|
 |
|
| |
|
|