introdu.awt
Post on 22-Oct-2014
459 views
DESCRIPTION
TRANSCRIPT
http://improvejava.blogspot.in/
Overview of AWT Classes
1
http://improvejava.blogspot.in/
On completion of this period, you would be able to know
• Overview of AWT Classes
2
Objective
http://improvejava.blogspot.in/
Recap
3
In the previous class, you have leant
• The simple applet programs
http://improvejava.blogspot.in/
AWT Classes
4
• AWT stand for ‘Abstract Windowing Toolkit’
• The AWT classes are available in the java.awt package
• It is one of Java’s largest packages
• The main purpose of the AWT is to support applet windows
• It can also be used to create stand-alone windows that run in a GUI environment, such as Windows
http://improvejava.blogspot.in/
AWT Classes contd..
5
• The basic structure of the AWT has been the same since Java 1.0
• Some of the original methods were deprecated and replaced by new ones when Java 1.1 was released
• For backward-compatibility, Java 2 still supports all the original 1.0 methods
• The following tables lists the important AWT classes
5
http://improvejava.blogspot.in/
AWTEvent Encapsulates AWT events
Button Creates a push button control
Canvas A blank, semantics-free window
Checkbox Creates a check box control
CheckboxGroup Creates a group of check box controls
CheckboxMenuItem Creates an on/off menu item
Choice Creates a pop-up list
Color Manages colors in a portable, platform-independent
fashion
Component An abstract superclass for various AWT components
Container A subclass of Component that can hold other
components
AWT Classes contd..
6
http://improvejava.blogspot.in/
Cursor Encapsulates a bitmapped cursor
Dialog Creates a dialog window
Dimension Specifies the dimensions of an object, i.e. width and 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
Frame Creates a standard window that has a title bar, resize
corners, and a menu bar
Graphics Encapsulates the graphics context. This context is
AWT Classes contd..
7
http://improvejava.blogspot.in/
Image Encapsulates graphical images
Insets Encapsulates the borders of a container
Label Creates a label that displays a string
List Creates a list from which the user can choose. Similar to
the standard Windows list box
MediaTracker Manages media objects
Menu Creates a pull-down menu
MenuBar Creates a menu bar
MenuComponent An abstract class implemented by various menu classes
MenuItem Creates a menu item
MenuShortcut Encapsulates a keyboard shortcut for a menu item
AWT Classes contd..
8
http://improvejava.blogspot.in/
Panel The simplest concrete subclass of Container
Point Encapsulates a Cartesian coordinate pair, stored in x and y
Polygon Encapsulates a polygon
PopupMenu Encapsulates a pop-up menu
PrintJob An abstract class that represents a print job
Rectangle Encapsulates a rectangle
Scrollbar Creates a scroll bar control
ScrollPane A container that provides horizontal and/or vertical scroll bars
for another component
SystemColor Contains the colors of GUI widgets such as windows, scroll
bars, text, and others
TextField Creates a single-line edit control
AWT Classes contd..
9
http://improvejava.blogspot.in/
TextArea Creates a multiline edit control
TextComponent
A superclass for TextArea and TextField
Toolkit Abstract class implemented by the AWT
Window Creates a window with no frame, no menu bar, and no title
AWT Classes contd..
10
http://improvejava.blogspot.in/
Discussion
• Compare the names of Java’s AWT components with VB’s GUI controls
In Java In VB
Label Label
TextField Textbox
TextArea Textbox
Choice ComboBox
Button CommandButton
11
http://improvejava.blogspot.in/
Summary
• In this class we have discussed– The AWT classes– Listed AWT classes with proper description
12
http://improvejava.blogspot.in/
Quiz
1.Which of the following classes is not in awt package
a) Button
b) Thread
c) Panel
d) Menu
13
http://improvejava.blogspot.in/
Quiz contd..
2. Which of the following classes is not useful for user data entry
a) TextField
b) TextArea
c) Label
d) Choice
14
http://improvejava.blogspot.in/
Frequently Asked Questions
1. List the AWT classes that are useful for user data entry
2. List the AWT classes for menu processing
15