Object-Oriented Programming OvalDraw Plus (Java code) Summary: Create a graphical application with Java that that draws an oval Prerequisites: Java, VS Code, and Terminal Create a graphical Java application that runs on Microsoft Windows and MacOS that draws an oval centered in the main application window when the programming starts. The oval should automatically resize and reposition itself when the window is resized.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Object-Oriented Programming

OvalDraw Plus (Java code)

Summary: Create a graphical application with Java that that draws an oval

Prerequisites: Java, VS Code, and Terminal

Create a graphical Java application that runs on Microsoft Windows and MacOS that draws an oval centered in the main application window when the programming starts. The oval should automatically resize and reposition itself when the window is resized.

In this activity you will start with our OvalDraw application in our sample code, review the code, and then make incremental improvements to the application. Be sure to make the resulting application uniquely your own by adding standard comments at the top application (i.e. your name, class, etc.), changing the names of variables, and adding small features. Finally, be sure to save your work as you will often be asked to submit it as part of an assignment.

Be sure to review the example OvalDraw project in the Java section of our example code repository.

Requirement 1: Create an application that:

1. Is implemented in a single Java (.java) file named “OvalDrawPlus.java”

2. Successfully compiles with “javac *.java" and successfully executes with “java OvalDrawPlus”

3. Has a simple yet an aesthetically pleasing user interface

Requirement 2: Be sure that the application also:

1. Opens a resizable main window with an initial height of 500 and a width of 400

2. Positions the upper left corner of the main window at 250 units from the left and 150 units from the top of the screen

3. Prints “Starting OvalDrawPlus...” in the terminal window when the application starts

Requirement 3: Enhance the application so that it:

1. Draws an oval with a filled color other than red, blue, or black when the application starts

2. Centers the oval so that it touches each edge of the window

3. Resizes the oval when the application window is resized

Requirement 4: Finally enhance the application so that it:

1. Draws a dark blue rectangle directly behind the oval

2. Utilizes constants at the top of the file to define the rectangle color

3. Prints “Closing OvalDrawPlus...” in the terminal window when the application is exited

Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Running Time of Application
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education