AWT Components in Java

The Abstract Window Toolkit (AWT) is Java’s original platform-dependent windowing, graphics, and user-interface widget toolkit preceding Swing.AWT Components in Java

Java AWT Create Color Object

With colors and fonts, readability increases as important noteworthy topics can be colored. All the latest operating systems support colors and fonts and allow customizing also. To support colors and fonts, the java.awt package includes Color class and Font class. Standard Color Models Color can be specified in two formats – RGB and HSB. 1. …

Java AWT Create Color Object Read More »

Java make Button Invisible

After learning GUI creation through 8 steps, for more command over button event handling, apart this one, another two programs are given – Changing Button Label and Making Button Enabled. Example on Java make Button Invisible In the following program, three buttons are created with labels Red, Green and Blue. When Red button is clicked, …

Java make Button Invisible Read More »

Java AWT GridLayout Manager

After knowing the importance of layout managers, FlowLayout and BorderLayout, let us study the other layout manager – GridLayout. As the name indicates the container is divided into a grid of cells dictated by rows and columns. Each cell accommodates one component. Like with FlowLayout, in GridLayout also, the position need not be mentioned. But …

Java AWT GridLayout Manager Read More »

BorderLayout Manager Example

BorderLayout Manager Example: After knowing the layout managers, FlowLayout and GridLayout functionality, let us go to the style of BorderLayout arrangement of components in a container. As the name indicates the container is divided into 5 regions – 4 borders (North, South, East, West) and 1 Center. Following are the properties of BorderLayout manager. Components …

BorderLayout Manager Example Read More »

TextField User Name Password Validation

After Button, the most used AWT component is TextField. TextField is useful to take input from the user and also to display output to the user by the programmer. User can write and edit the text in the TextField. Programmatically, the TextField can be made non-editable. Pressing Enter key generates ActionEvent and can be handled …

TextField User Name Password Validation Read More »