Technical Support
Discussion Forum
Online Training
Read About Java
Java In-Depth
Product Discounts
Membership Information

Java Cup Logo

JDC Home Page


Top
Back
Next
Online Training
shadowSearchFAQFeedback

Button

A Button is a pushbutton widget with a label that can 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:

  • public Button(String label)
    Creates a Button with a label.

Related exercise(s):