A well laid out user interface is an effective means of making applications user-friendly. It is typically used by organizations for accepting orders from customers, getting customer’s feedback on a product, for conducting a market survey on the latest trends in economy.
All components are implemented as subclass of the Component class. The subclasses inherit a substantial amount of functionality from the Component class. The basic features of the Component class are:
Drawing Support: The component class provides paint (), update() and repaint() methods to help us draw the components on the screen.
Event-Handling: A component is capable of delegating its event (like button click, mouse move) to other classes for processing. We will explore event handling in detail in the later part of the tutorial.
Apperance Control: The component class provides methods for getting information about the current font, foreground and background color. Custom drawing of components is also made possible because of this.
Image-Handling: The component class provides an implementation of the ImageObserver interface and defines methods to help components display images.
Sizing And Positioning Of Controls: The size and position of all components are subjected to the requirement specified by the layout manager. Although each component can somewhat determine its own size and position, the component class provides methods to resize and position components as preferred by the programmer.
Now that we have laid the foundation about Java AWT, we will be examining each of them in-depth in the subsequent parts of this tutorial.