R4R
Right Place For Right Person TM
 

R4R Java Advance Java AWT Index

R4R
provide basic AWT Tutorials concept with AWT Examples . Through R4R you can develop AWT programming concept. R4R provide AWT Interview Questions with answers.R4R provide AWT Languages study materials in easy way.

AWT Tutorials

1.1    AWT Basic Tutorials

AWT Examples

2.1    AWT Basic Example (new)
2.2    
AWT Example

AWT Interview Questions with Answers

3.1  AWT Interview Questions And Answers
3.2  
AWT Objective Questions
3.3  
AWT Interview Questions And Answers
3.3  
AWT FAQS


Abstract Window Toolkit( AWT)

Abstract Window Toolkit release with java in 1995 by Sun Microsystems, provided a thin level of abstraction over the underlying native user interface.  Main purpose of AWT is to support the Graphical user Interface( GUI) in programming. It is the part of the Java Foundation Classes (JFC) — " the standard Application Programming Interface (API) for providing a graphical user interface (GUI) for a Java program". It's all the class must extend the  AWT Packages, which are of two types-

  • java.awt package - Contains all of the classes for creating user interfaces and for painting graphics and images.

  • java.awt.event package - Provides interfaces and classes for dealing with different types of events fired by AWT components.

    AWT features include:
     

  • It is a robust event-handling model.

  • Support the graphics and imaging tools, including shape, color, and font classes

  • Support the native user interface components in program.

  • The Swing classes are built on top of the AWT architecture.

  • Also support to data transfer classes, in cut-and-paste form through the native platform/ clipboard.

  • Define a layout managers, for flexible window layouts that do not depend on a particular window size or screen resolution ( i.e. totally independent from platform).

Architecture of AWT.
Since, AWT is the heavy weight component, but provide a general interface between Java and the native system, used for windowing,  layout managers, and events. The AWT provides two levels of APIs:

  •  First and important API is at the core of Java GUI programming and is also used by Swing and Java 2D. It contains:

    •  Several layout managers like FlowLayout, GridLayout, and BorderLayout.
    •  The interface between the native windowing system and the Java application.
    • The interface to input devices such as mouse and keyboard by different ActionListen classes.
    •  A java.awt.datatransfer package for use Cut-and-paste, Drag and Drop from through the Native platform/ clipboard.
       
  •  A basic set of GUI widgets such as buttons, text boxes, text Area,  and menus. It also provides the AWT Native Interface in program, which enables rendering libraries compiled to native code to draw directly to an AWT Canvas object drawing surface.
  • Neither Swing nor AWT are inherently thread safe because both strongly support native Interface. Therefore, code that updates the GUI/ Processes events must be execute on the Event dispatching thread and if execute is failure , result in a deadlock or race condition, to solve such problem, use a Utility class called as SwingWorker which allow applications to perform time-consuming tasks following user-interaction events in the event dispatching thread.

New Updates

R4R
R4R
R4R
R4R
R4R
R4R
R4R
R4R