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.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter11: Advanced Inheritance Concepts
Section: Chapter Questions
Problem 8PE
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
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage