Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A Colored Window Class (ColoredWindow) Code the following ColoredWindow subclass of Window: Specification: A ColoredWindow is a Window with a background color accepts a width,

A Colored Window Class (ColoredWindow)

Code the following ColoredWindow subclass of Window: Specification:

A ColoredWindow is a Window with a background color

accepts a width, height, and background color(in the form of a character);

omitting the color defaults to '.' (i.e., you should have a second overloaded constructor)

a toString that returns the width, height and color of the window (see Sample Run)

methods getColor and setColor

displayNormal fills the window with the color

************ ************ ************ ************ ************ ************ ************ ************ 

a (static) read method

I've provided an application class, ColoredWindowApp, for testing your class.

Sample Test Run

If the file window.data contains:

4 9 # 

my application class produces the following output:

Creating a 5x10 colored window Displaying: (Nothing to see here) Setting visible to true and displaying: +++++ +++++ +++++ +++++ +++++ +++++ +++++ +++++ +++++ +++++ Minimizing and displaying: [a 5x10 window with background color '+' (minimized)] Restoring and displaying: +++++ +++++ +++++ +++++ +++++ +++++ +++++ +++++ +++++ +++++ Changing color to '%' and displaying: %%%%% %%%%% %%%%% %%%%% %%%%% %%%%% %%%%% %%%%% %%%%% %%%%% Resizing to 10x5 and displaying: %%%%%%%%%% %%%%%%%%%% %%%%%%%%%% %%%%%%%%%% %%%%%%%%%% Minimizing and displaying: [a 10x5 window with background color '%' (minimized)] Creating a window from file data and displaying (Nothing to see here) Setting visible to true and displaying: #### #### #### #### #### #### #### #### #### Minimizing and displaying: [a 4x9 window with background color '#' (minimized)]

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

Inductive Databases And Constraint Based Data Mining

Authors: Saso Dzeroski ,Bart Goethals ,Pance Panov

2010th Edition

1489982175, 978-1489982179

More Books

Students also viewed these Databases questions