Abstract Window Toolkit || Introduction to AWT || Bcis Notes

Abstract Window Toolkit || Introduction to AWT || Bcis Notes

Abstract Window Toolkit

 

AWT stands for Abstract Window Toolkit. It is a platform-dependent API for creating Graphical User Interface (GUI) for Java programs.

Abstract Window Toolkit (AWT) is a set of application program interfaces ( API s) used by Java programmers to create graphical user interfaces ( GUI ) objects, such as buttons, scroll bars, and windows. AWT is part of the Java Foundation Classes ( JFC ) from Sun Microsystems, the company that originated Java. The JFC is a comprehensive set of GUI class libraries that make it easier to develop the user interface part of an application program.

A more recent set of GUI interfaces called Swing extends the AWT so that the programmer can create generalized GUI objects that are independent of a specific operating system’s windows system.

 Why AWT is platform dependent? 

 

Java AWT calls native platform (Operating systems) subroutine for creating components such as textbox, checkbox, button etc. For example, an AWT GUI having a button would have a different look and feel across platforms like Windows, Mac OS & Unix, this is because these platforms have different look and feel for their native buttons and AWT directly calls their native subroutine that creates the button. In simple, an application build on AWT would look like a windows application when it runs on Windows, but the same application would look like a Mac application when runs on Mac OS.

AWT is rarely used nowadays because of its platform-dependent and heavy-weight nature. AWT components are considered heavyweight because they are being generated by the underlying operating system (OS). For example, if you are instantiating a text box in AWT that means you are actually asking OS to create a text box for you.

Swing is a preferred API for window-based applications because of its platform-independent and light-weight nature. Swing is built upon AWT API however it provides a look and feels unrelated to the underlying platform. It has more powerful and flexible components than AWT. In addition to familiar components such as buttons, checkboxes, and labels, Swing provides several advanced components such as tabbed panel, scroll panes, trees, tables, and lists. We will discuss Swing in detail in a separate tutorial.

 

you may also like Types and Evolution of Operating System

Be the first to comment

Leave a Reply

Your email address will not be published.


*