Sunteți pe pagina 1din 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

S-ar putea să vă placă și