0% found this document useful (0 votes)
102 views

Abstract Window Toolkit (AWT) : - by Utkarsh Rai

Java AWT (Abstract Window Toolkit) is an API that allows developers to create graphical user interfaces (GUIs) in Java. It contains predefined classes for GUI components like buttons, text fields, and labels. The key AWT components are platform-dependent and include containers like Frame and Panel, as well as non-container components. Frame is a top-level container that displays a title bar and can hold menus, while Panel is a generic container that holds other components but lacks its own borders or menus. AWT also provides methods for modifying component properties and layout.

Uploaded by

Fijfjvkvgh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
102 views

Abstract Window Toolkit (AWT) : - by Utkarsh Rai

Java AWT (Abstract Window Toolkit) is an API that allows developers to create graphical user interfaces (GUIs) in Java. It contains predefined classes for GUI components like buttons, text fields, and labels. The key AWT components are platform-dependent and include containers like Frame and Panel, as well as non-container components. Frame is a top-level container that displays a title bar and can hold menus, while Panel is a generic container that holds other components but lacks its own borders or menus. AWT also provides methods for modifying component properties and layout.

Uploaded by

Fijfjvkvgh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Java

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.

public void defines the layout manager for the


setLayout(LayoutManager m) component.

public void setVisible(boolean changes the visibility of the


status) component, by default false.

10
Thanks!

Reference : ttps://www.tutorialspoint.com/awt/
https://www.javatpoint.com/java-awt11

You might also like