1.1 Component, Container, window, frame, panel
➢ AWTEventMulticaster - Dispatches events to multiple listeners.
➢ Canvas - A blank, semantics-free window.
➢ Container - : A subclass of Component that can hold other
components.
➢ Cursor - : Encapsulates a bitmapped cursor.
➢ Dialog - : Creates a dialog window.
➢ Dimension - : Specifies the dimensions of an object. The width
is stored in width, and the height is stored in height.
➢ Event - : Encapsulates events.
➢ EventQueue - : Queues events.
➢ FileDialog -: Creates a window from which a file can be
selected.
➢ Font - : Encapsulates a type font.
➢ FontMetrics - : Encapsulates various information related to a
font. This information helps you display text in a window
➢ Panel The simplest concrete subclass of Container.
➢ Compoenent is an abstract class
➢ A Component object is responsible for remembering the current
foreground and background colors and the currently selected
text font.
➢ A container is responsible for laying out (that is, positioning)
any components that it contains. It does this through the use of
various layout managers
, 1.2 AWT Components and Layout Managers
➢ AWT – Abstract Windowing ToolKit
➢ Buttons in AWT are also called as Push Buttons
➢ Add() method is defined by container
➢ Remove() and RemoveAll() are the two methods defined by
container. Remove(Component obj) method is used to remove
a control of specified Component obj. And RemoveAll() is used
to Remove the controls of all components.
➢ Label is Passive Component.
➢ Label Constructors –
• Label( ) throws HeadlessException Example – Label();
• Label(String str) throws HeadlessException Example –
Label(“Aneesh”);
• Label(String str, int how) throws HeadlessException
Example – Label(“Aneesh”, Label.LEFT)
➢ There are 3 types of alignments of lables – LEFT, RIGHT,
CENTER
➢ setAlignment() is used to set alignment of the label
➢ getAlignment() is used to get alignment of the label
➢ Button() throws HeadlessException
➢ Button –: Listener - ActionListener() Method –
actionPerformed() Event - ActionEvent