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

Java AWT

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

Java AWT

Java AWT
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Java AWT

S.Kavitha
Head & Assistant Professor
Department of Computer Science
Sri Sarada Niketan College of Science for
Women,Karur.
• Java AWT (Abstract Window Toolkit) is an API
to develop Graphical User Interface (GUI) or
windows-based applications in Java.
• Java AWT components are platform-
dependent i.e. components are displayed
according to the view of operating system.
AWT is heavy weight i.e. its components are
using the resources of underlying operating
system (OS).
Java AWT Hierarchy
Components
• All the elements like the button, text fields,
scroll bars, etc. are called components.
• In Java AWT, there are classes for each
component as shown in above diagram.
• In order to place every component in a
particular position on a screen, we need to
add them to a container.
Container
• The Container is a component in AWT that can
contain another components like buttons,
textfields, labels etc.
• The classes that extends Container class are
known as container such as Frame,
Dialog and Panel.
There are four types of containers in Java AWT:
• Window
• Panel
• Frame
• Dialog
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.
• We need to create an instance of Window
class to create this container.
Panel
• The Panel is the container that doesn't contain
title bar, border or menu bar. It is generic
container for holding the components.
• It can have other components like button,
text field etc. An instance of Panel class
creates a container, in which we can add
components.
Frame
• The Frame is the container that contain title
bar and border and can have menu bars.
• It can have other components like button, text
field, scrollbar etc.
• Frame is most widely used container while
developing an AWT application.

You might also like