Coders Packet

Making GUI using AWT and Swing Toolkits in Java

By Rasika Deshpande

In this project, a simple GUI is built in Java. Abstract Windowing Toolkit (AWT) and Swing Toolkits are used.

Prerequsites:

1. Java JDK should be installed in your PC.

2. A code editor to write the java code. Here are 2 great editors for java: Visual Studio Code and Eclipse.

 

About the code:

In this project, a simple GUI with two buttons and some text are displayed. Count is displayed which either increments or decrements according to the button which is being clicked by the user. 

JLabel, JFrame, JPanel and JButton are the containers from Swing Toolkit which are used to to create the components of GUI like the frame, label panel and buttons. 
 

How can you make it Personalized?

You can change the size of the frame, the grid layout property, the border size and color. You can add more buttons or functions to your GUI. Read the comments written in the code to easily change the design and make the GUI personalized.

 

Download Complete Code

Comments

No comments yet