Goseeko blog

What is Java AWT?

by Bhumika

The Java AWT API is a set of classes and methods for developing and managing GUI applications. In addition, The AWT was created to provide a standardized set of tools for creating graphical user interfaces that could be used on a range of systems. Furthermore, The AWT tools are construct using each platform’s native GUI toolkit, preserving the platform’s look and feel. This is one of the benefits of adopting AWT. 

Swing is built on top of the AWT framework, i.e. Swing is an enhanced GUI API that extends the AWT. However, nowadays, AWT is only utilize since most GUI Java programmes write in Swing, which has a large set of GUI capabilities and is lightweight.

 Java AWT class hierarchy

The Java AWT class hierarchy is being shown below; all of the classes find in the java.awt package.

Fig : class hierarchy

Components class

The Component class is at the top of the AWT hierarchy. Moreover, Component is an abstract class that encapsulates all of the visual component’s properties. In addition, All user interface elements that are display on the screen and interact with the user, with the exception of menus, are subclasses of Component. 

Container 

Components have a subtype called Container. It contains additional methods that allow it to nested within other Component instances. Containers can used to store other Container objects (since they are themselves instances of Component). As a result, a multileveled containment system is creates. Any components that it contains might laid out (that is, positioned) by a container.

Panel 

Container has a concrete subclass called Panel. In addition, A Panel is a concrete screen component that can nested indefinitely. Applet has a superclass called Panel. Screen output is draw on the surface of a Panel object when it is points to an applet. On the other hand, In its most basic form, a Panel is a window that lacks a title bar, menu bar, or border. 

Window 

A top-level window is create with the Window class. In addition, A top-level window is unenclosed by any other object and sits alone on the desktop. In most cases, you won’t directly create Window objects.

Frame 

The term “frame” encompasses what is typically refer to as a “window.” It has a title bar, menu bar, borders, and resizing corners and is a subclass of Window. Furthermore, The exact appearance of a Frame will vary depending on the environment.

Interested in learning about similar topics? Here are a few hand-picked blogs for you!

You may also like