100% found this document useful (1 vote)
146 views9 pages

AWT Controls

The document discusses AWT layout managers and containers. It explains that layout managers automatically position components within containers and that containers provide space for components. It lists common layout managers like BorderLayout, CardLayout, and GridLayout. It describes containers like Panel, Frame, and Window and notes that containers can only add components. The document also shows the hierarchical structure of AWT classes.

Uploaded by

prajapati dhruv
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
146 views9 pages

AWT Controls

The document discusses AWT layout managers and containers. It explains that layout managers automatically position components within containers and that containers provide space for components. It lists common layout managers like BorderLayout, CardLayout, and GridLayout. It describes containers like Panel, Frame, and Window and notes that containers can only add components. The document also shows the hierarchical structure of AWT classes.

Uploaded by

prajapati dhruv
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 9

AWT

Awt LayOut

 we can say that placing the components at a particular position


within the container.
 The task of layouting the controls is done automatically by the
Layout Manager.
 Layout Manager
 The layout manager automatically positions all the components within
the container.
 If we do not use layout manager then also the components are
positioned by the default layout manager.
 The interfaceLayoutManager is used to define the interface for classes
that know how to lay out Containers.
Layout

 BorderLayout
 CardLayout
 FlowLayout
 GridLayout
Awt Containers

 Containers are integral part of AWT GUI components.


 A container provides a space where a component can be located.
 Following are noticable points to be considered.
 Sub classes of Container are called as Containter. For example Panel,
Frame and Window.
 Container can add only Component to itself.
 A default layout is present in each container which can be overridden
using setLayout method.
List Of container

 Panel :
 Panel is the simplest container. It provides space in which any other
component can be placed, including other panels.
 Frame :
 A Frame is a top-level window with a title and a border
 Window :
 A Window object is a top-level window with no borders and no
menubar.
Every user interface considers the
following three main aspects:
 UI elements :
 Thes are the core visual elements the user eventually sees and interacts with.
 Layouts :
 They define how UI elements should be organized on the screen and provide
a final look and feel to the GUI (Graphical User Interface).
 Behavior :
 These are events which occur when the user interacts with UI elements.
Object

component

Container

window panel

Button, Text,
List
frame Layout panels

Hierarchical Structure of
classes
Component Class
 A Component is an abstract super class for GUI controls and it represents an
object with graphical representation.

 Following is the declaration for java.awt.Component class:

public abstract class Component


extends Object
implements ImageObserver , MenuContainer ,Serializable
AWT UI Elements:
 Label
 Button
 Checkbox
 checkBoxGroup
 List
 TextField
 TextArea
 Choice
 Image
 ScrollBar
 Dialog
 File Dialog

You might also like