0% found this document useful (0 votes)
103 views2 pages

Java Module 6 - GUI Assignment

This document provides instructions for three Java GUI programming assignments: 1) Create a frame with a text area, add and clear buttons, and text field to append and clear text. 2) Create a menu with options to quit, change the frame color, and reset to white. 3) Create an application that displays mouse, mouse motion, and keyboard events in a text field.

Uploaded by

Apoorva Panchal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
103 views2 pages

Java Module 6 - GUI Assignment

This document provides instructions for three Java GUI programming assignments: 1) Create a frame with a text area, add and clear buttons, and text field to append and clear text. 2) Create a menu with options to quit, change the frame color, and reset to white. 3) Create an application that displays mouse, mouse motion, and keyboard events in a text field.

Uploaded by

Apoorva Panchal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 2

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.

You might also like