Abstract Window Toolkit (AWT) : - by Utkarsh Rai
Abstract Window Toolkit (AWT) : - by Utkarsh Rai
Abstract Window
Toolkit (AWT)
-By Utkarsh Rai
Introduction
❖ Java AWT (Abstract Window Toolkit) is
an API to develop GUI or window
based applications in java.
❖ GUI is build of graphical element
called components.
2
AWT Components
❖ Java AWT components are
platform-dependent i.e. components
are displayed according to the view of
operating system.
❖ The Container class is a subclass of
Component.
3
“
In Java GUI can be design using
some predefined classes. All these
classes are defined in java.awt
package
4
The AWT provides nine basic
non-container component and three
container classes.
5
“
Container
The Container is a component in AWT that
can contain another components like
buttons, text-fields, labels etc. The classes
that extends Container class are known as
container such as Frame, Dialog and Panel.
6
“
Window
The window is the container that have no
borders and menu bars. You must use
frame, dialog or another window for
creating a window.
7
“
Panel
The Panel is the container that doesn’t
contain title bar and menu bars. It can have
other compontents like button, textfield etc.
8
“
Frame
The Frame is the container that contain title
bar and can have menu bars. It can have
other components like button, textfield etc.
9
Useful Methods of Component class
Method Description
inserts a component on this
public void add(Component c)
component.
public void setSize(int width,int sets the size (width and height) of
height) the component.
10
Thanks!
Reference : ttps://www.tutorialspoint.com/awt/
https://www.javatpoint.com/java-awt11