Button

A Button is a pushbutton widget with a label that may be pushed with a mouse click:



Corresponding source code:

import java.applet.*;
import java.awt.*;
public class ButtonWidget extends Applet {
    public void init() {
        Button b = new Button("OK");
        add(b);
    }
}

Method(s) of note:

Related Magercise(s):