Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How to set up a simple GUI based on JFrame Setting up listeners and responding to events Drawing simple shapes Dealing with mouse and mouse

image text in transcribed

image text in transcribed

How to set up a simple GUI based on JFrame Setting up listeners and responding to events Drawing simple shapes Dealing with mouse and mouse motion events Directions l. Write a GUI application in Java using Swing that has three buttons and a drawing area 2. Give the window an initial size of 800 x 800 pixels, and put your name in the menu bar. 3. The buttons should be at the top of the window and be labeled "Ova Rectangle", and Specia 4. The drawing area should cover the remainder of the window. 5. When it starts, the program should show nothing in the drawing area, but the background of the drawing area should be a non-white color. 6. Pressing the Oval or Rectangle buttons should toggle (turn on or off the display of an oval or rectangle, either or both of which must be visible at the same time. When drawn, the oval and rectangle should be different colors of your choice 7. You must also be able to click and drag the rectangle or oval around the screen with the mouse 8. When the user presses the "special" button, the program should do something else not described in the assignment that is unique to your program, such as change the color of all the things you draw, switch the oval to be outlines instead of filled, or draw your name in the middle of the window. 9. As always, make sure the proper block comment is at the top of your main file with your name 10. Once your program is working, pass it off directly to the instructor or TA. Also, turn in your code to D2L

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatial Database Systems Design Implementation And Project Management

Authors: Albert K.W. Yeung, G. Brent Hall

1st Edition

1402053932, 978-1402053931

More Books

Students also viewed these Databases questions