Java Lab Assignment: GUI and Event Handling
1. Write a java (GUI) program to create an empty Frame. Set the title of the frame to "My First GUI
Frame". The frame is initially invisible and must be made visible by invoking its "setVisible()"
method. Using (a) Frame class, (b) JFrame class, and (c) Extends from JFrame.
2. Write a java (GUI) program to create (and to display) two frames. One frame is the "master" frame.
Click its close button, and everything closes down. The other frame is temporary. Click its close
button, and only it is closed.
3. Write a java (GUI) program to create label, button and textbox into a frame using (a) JFrame class
and the following layout, and (b) Frame class and the following layout.
a) Default Layout
b) Flow Layout
c) Border Layout
d) Grid Layout
4. Write a java (GUI) program to create MenuBar, Menus and MenuItem into a frame.
5. Write a java (GUI) program to create Radio Buttons, Combo box and Check Boxes. Also create two
panels which include those Radio Buttons, Combo box and Check boxes.
6. Write a java (GUI) simple program as following specification:
There will be one text box, one command button. User will click on command button, the number
will increment into the textbox.
7. Write a java (GUI) simple program as following specification:
There will be two commands (Red and Green). If user clicks on Red button red color will display on
the frame and if clicks on Green button green color will display on the frame.
8. Write a java (GUI) program as following specification:
There will be a MenuBar, Menus and MenuItems. User will click on MenuItem, the output will
display on the output screen.
9. Write a java (GUI) program for temperature converter (Fahrenheit to Celsius).
There will be a text box, user will enter a number.
There will be another text box that will show the conversion result.
There will be a command button where user will click for the conversion result.