Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started