Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Code the following JAVA BorderedWindow subclass of Window: Specification: A BorderedWindow is a Window with an outer border accepts a width and height To accommodate

Code the following JAVA 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 resizemethods

a toString that returns the width, height of the window (from the caller's point-of-view, i.e., NOT including the borders)

has a displayNormal method that displays a representation of the window of height lines each of which contains width spaces.

+------------+ | | | | | | | | | | | | | | | | +------------+ 

This method implements the corresponding abstract method of the Window superclass

It must be declared public as methods declared in an interface default to public.

a (static) read method

The name of your class should be BorderedWindow.

. Please remove public from your class header.

Your class is tested by a BorderedWindowApp class. No auxiliary minimal class is required, since BorderedWindow is a 'concrete' class, and objects of its type may be created. This is for informational purposes only and does not affect your coding of the Window class. The only thing you should be submitting is the code for BorderedWindow.

For example, if the file window.data contains:

8 3 

the expected output of the ColoredWindowApp application is:

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

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

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

13th Edition Global Edition

1292263350, 978-1292263359

More Books

Students also viewed these Databases questions

Question

What is the most important part of any HCM Project Map and why?

Answered: 1 week ago