Java Module 6 - GUI Assignment
Java Module 6 - GUI Assignment
1. Write a JAVA Program to display a frame with one JTextArea, two JButtons, and one JTextField as
shown in below Figure. Handle the click event on ADD and CLEAR button. When user clicks on the
ADD button, the text entered into JTextField should be appended to the JTextArea. When user clicks
on the CLEAR button, text from the JTextArea should be removed.
2. Write a MyMenuFrame class with these menu choices. When the user selects Quit, stop the
program. When the user selects one of the colors, change the background of the frame (i.e., change
the background color of the frame’s content pane) to the selected color. When the user selects
Erase, reset the background color to white.
3. Create an application to illustrate mouse events, mouse motion events, and keyboard events as per
given below Figure. The key code corresponding to a key event or the position of the mouse is
displayed just above the text field.