Question: A Bordered Window Class (BorderedWindow) Code the following BorderedWindow subclass of Window: Specification: A BorderedWindow is a Window with an outer border accepts a width
A Bordered Window Class (BorderedWindow)
Code the following BorderedWindow subclass of Window: Specification:
A BorderedWindow is a Window with an outer border
accepts a width and height
To accommodate the border, the window must be created with a width and height 2 more than that specified in its constructor
However to the outside world, the window is the original specified size this means you must override the getWidth and getHeight, (and resize) methods
has a displayNormal method that displays a representation of the window of height lines each of which contains width spaces.
+------------+ | | | | | | | | | | | | | | | | +------------+
a (static) read method
Sample Test Run
For example if the file window.data contains:
8 3
an application program might produce the following output:
Creating a 5x10 bordered window Displaying: (Nothing to see here) Setting visible to true and displaying: +-----+ | | | | | | | | | | | | | | | | | | | | +-----+ Minimizing and displaying: [a 5x10 window with a border (minimized)] Restoring and displaying: +-----+ | | | | | | | | | | | | | | | | | | | | +-----+ Resizing to 10x5 and displaying: +----------+ | | | | | | | | | | +----------+ Minimizing and displaying: [a 10x5 window with a border (minimized)] Creating a window from file data and displaying (Nothing to see here) Setting visible to true and displaying: +--------+ | | | | | | +--------+ Minimizing and displaying: [a 8x3 window with a border (minimized)]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
