Basic AWT Component: Button
A Button is the familiar way to allow a user to cause an event by clicking with the mouse and is created with a String to label it
- Button button1 = new Button("Click here");
- add (button1);
AWT Buttons are normally created to appear in the style of the user's windowing system, except that you can control the color of the button and the String
- button1.setBackground (Color.cyan);
- button1.setForeground (Color.black);