java.awt Package

The Abstract Window Tollkit package provides for windows and the various ways of displaying information and interacting with them.

This package is imported by the statement

import java.awt.*

Individual parts of the package can be imported for instance

import java.awt.Button

The following is a list of the methods in this package that you might find useful. The table provides the heading for the method, which provides the name and the parameters needed.

public BorderLayout (string label) Creates a new border layout manager
public Button (string label) Creates a button with the label
public String getLabel () Returns the label on this button
public Canvas () Creates a canvas
public void paint (Graphics g) Repaints the canvas. This method is usually overriden by the proogrammer.
public Checkbox (String s) Create a check box with the label s
public Checkbox (String s, Checkbox Group g, boolean state Ctreate a check box with the label s, within the check box group g and with initial state.
public boolean getState () returns the state of the check box
public CheckbpxGroup () Creates a new check box group to which check boxes can be added
public Choice () Creates a new choice box group to which choices can be added
public void addItem (String item) Add an item to this choice box
public String getSelectedItem () Returns the item selected
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License