AWT in java a short explanation
Introduction
The Java Foundation Class (JFC) provides two frameworks for building GUI-based applications.
1 AWT
2 Swing
What is the framework?
A framework is a collection of predefined classes and functions used to process input and control hardware devices that interact with system software.
This article provides a brief overview of AWT.
What is AWT in java?
The Abstract Window Toolkit(AWT) is the user interface toolkit
Provided as part of the java language class library.
AWT components requires java.awt package.
The class hierarchy of AWT
Figure shows the class hierarchy of AWT
A component is an object that can be displayed on the screen and can interact with the user.
A container is a component that can be displayed on the screen and contains other components.
A window is a container with some special features such as a toolkit for creating components and warning messages for security purposes.
The Frame class is a subclass of the window class.
Frame windows are the standard objects used for drawing graphics. Frame has a title bar, a cursor, an icon and menus.
The key concepts of AWT class hierarchy are:
- Component is an abstract class.All other classes are non-abstract(concrete)
- Component class is super-class of all the non-menu-related user-interface classes.It provides support for event handling, drawing of components and so on.
- The panel class does not have a title,menu or border.The Applet class is used to run programs that run in a web browser.
- The window class represents a top-level window,Neither window nor panel classes has title,menus,or borders.The window class is rarely used directly and its sub-classes frame and dialog are more common.
Comments
Post a Comment