Java AWT (Abstract Window Toolkit)

Java AWT (Abstract Window Toolkit) is an API to develop Graphical User Interface (GUI) or windows-based applications in Java.

The Abstract Window Toolkit (AWT) supports Graphical User Interface (GUI) programming. AWT features include:

  • A set of native user interface components
  • A robust event-handling model
  • Graphics and imaging tools, including shape, color, and font classes
  • Layout managers, for flexible window layouts that do not depend on a particular window size or screen resolution
  • Data transfer classes, for cut-and-paste through the native platform clipboard
Useful Methods of Component Class

Method Used for
public void add Inserts a component on this component.
public void setSize Sets the size (width and height) of the component.
public void setLayout Defines the layout manager for the component.
public void setVisible Changes the visibility of the component, by default false.

Basic Programs