In this Example we will describe AWT in java. AWT in java stands for Abstract Windowing Toolkit and is a package available with JDK.
What is AWT in java
In this Example we will describe awt in java. The awt in java stands for Abstract Windowing Toolkit and is a package available with JDK. awt contains all classes and develops user interface objects like buttons, checkboxes, radio buttons, menus etc click here What is AWT in java full tutorials
We have described Interface and Description of AWT Package:-
Interfaces and Descriptions of AWT Package: | |
ActionEvent | is used for handling events. |
Adjustable | takes numeric value to adjust within the bounded range. |
Composite | defines methods to draw a graphical area. It combines a shape, text, or image etc. |
CompositeContext | allows the existence of several context simultaneously for a single composite object. It handles the state of the operations. |
ItemSelectable | is used for maintaining zero or more selection for items from the item list. |
KeyEventDispatcher | implements the current KeyboardFocusManager and it receives KeyEvents before despatching their targets. |
KeyEventPostProcessor | implements the current KeyboardFocusManager. The KeyboardFocusManager receives the KeyEvents after that dispatching their targets. |
LayoutManager | defines the interface class and it has layout containers. |
LayoutManager2 | is the interface extends from the LayoutManager and is subinterface of that. |
MenuContainer | has all menu containers. |
Paint | is used to color pattern. It used for the Graphics2Doperations. |
PaintContext | is used the color pattern. It provides an important color for the Graphics2D operation and uses the ColorModel. |
PaintGraphics | provides print a graphics context for a page. |
Shape | is used for represent the geometric shapes. |
Stroke | allows the Graphics2D object and contains the shapes to outline or stylistic representation of outline. |
Transparency | defines the transparency mode for implementing classes. |
Program Description
In this example We have create frame in java AWT package. The frame in java works like the main window where your components are added to develop a application. In the Java AWT, top-level windows are represented by the Frame class and we create Label, A Label object is a component for placing text in a container. A label displays a single line of read-only text. The text can be changed by the application, but a user cannot edit it directly.
Simple Example
import java.awt.Frame; import java.awt.Label; public class FrameExample { public static void main(String[] args){ Frame frame = new Frame("First Example AWT Frame"); Label lbl = new Label("Welcome to Roseindia.net.",Label.CENTER); frame.add(lbl); frame.setSize(400,400); frame.setVisible(true); } }