Showing posts with label COMPONENTS. Show all posts
Showing posts with label COMPONENTS. Show all posts

Monday, 3 March 2014

AWT CONTROLS IN JAVA:BUTTONS

AWT BUTTON Class

Create AWT Buttons with simple Example..........

The java.awt package comes with many GUI components of which Button is the most important and most frequently used. A button functionality (what for it is) can be known by its label like OK or Cancel etc. A mouse click on the button generates an action.

Following is the class signature

public class Button extends Component implements Accessible

Any GUI component with event handling can be broadly divided into 8 steps.

  • Import java.awt and java.awt.event packages
  • Extending frame or applet and implementing appropriate listener interface that can handle    the events of the component successfully.
  • Set the layout.
  • Create components
  • Register or link the component with the listener interface
  • Beautification of the components (optional)
  • Adding the components to the frame or applet
  • Override all the abstract methods of the listener interface

Monday, 24 February 2014

INTRODUCTION TO THE AWT

WHAT ARE AWT CLASSES IN JAVA


A description of Java's user interface toolkit

The Abstract Window Toolkit(AWT) contains numerous classes and methods that allow you to create and manage windows. Although the main purpose of the AWT is to support applet windows, it can also be used to create stand-alone windows that run in GUI environment, such as windows.The AWT classes are contained in the 'java.awt' package. Fortunately, because it is logically organized in a top-down,hierarchical fashion, it is easier to understand and use.