1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Natasha2012 [34]
3 years ago
12

The 'client area' of a window is the area used to display the contents of the window (thus a title bar or border would lie outsi

de the client area). For the Window class, the client area is nothing more than the entire window, and thus the height of the client area is nothing more than the value of the height instance variable.
Assume the existence of a Window class with existing methods, getWidth and getHeight. There is also a Window subclass, named TitledWindow that has an integer instance variable barHeight, containing the height of the title bar.
Write the method getClientAreaHeight for the TitledWindow class that returns the height (an integer) of the client area of a window with a title bar.
Computers and Technology
1 answer:
Stolb23 [73]3 years ago
6 0

Answer:

The Java code is given below

Explanation:

<u>Window.java: </u>

public class Window {

private int width, height;

public Window(int width, int height) {

this.width = width;

this.height = height;

}

public int getHeight() {

return height;

}

public void setHeight(int height) {

this.height = height;

}

public int getWidth() {

return width;

}

public void setWidth(int width) {

this.width = width;

}

@Override

public String toString() {

return "Window [width=" + width + ", height=" + height + "]";

}

}

<u>TitledWindow.java: </u>

public class TitledWindow extends Window {

private int barHeight;

public TitledWindow(int width, int height, int barHeight) {

super(width, height);

this.barHeight = barHeight;

}

public int getClientAreaHeight() {

return barHeight + super.getHeight();

}

@Override

public String toString() {

return "TitledWindow [width=" + super.getWidth() + ", height=" + super.getHeight() + ", barHeight=" + barHeight + "]";

}

}

<u>TestWindows.java: </u>

public class TestWindows {

public static void main(String args[]) {

Window w = new Window(450, 200);

System.out.println("Window: " + w);

TitledWindow titledWindow = new TitledWindow(450, 200, 30);

System.out.println("titaledWindow: " + titledWindow);

System.out.println("titledWindow.height: " + titledWindow.getClientAreaHeight());

}

}

You might be interested in
It takes you 0.8 of a minute to read each page of your health book. It takes you 5.5 minutes to take the test at the end. How lo
NeTakaya
The answer would be 13.3125 because 6.25 / 0.8 is 7.8125 than add 5.5 which will equal 13.3125. I'm sure about this.
7 0
2 years ago
Read 2 more answers
What is the argument in this function =AVERAGE(F3:F26)
monitta
The argument for the function would be answer "D".
5 0
2 years ago
In terms of system thinking, what is process?
Talja [164]

Answer:b) The computer program that processes the data.

Explanation: In the computer system , process is the part of computer program which are responsible for performing of the processing of the data and other functions .The working of the process is associated with the program code and related activities/functions.

Other options that are mentioned in the question are incorrect because they don't describe the process correctly .Thus , the correct answer is option (b).

5 0
3 years ago
Read 2 more answers
Which bitwise operation has the same effect as multiplying a by 16?
Shalnov [3]
<span>Jun 15, 2011 - Multiplication and division can be achieved using bit operators, for example .... I discovered pretty much the same thing for Sun CC close to 20 years ago. ... Just to add a rough estimation: On a typical 16-Bit processor ..... Doing it yourself willaffect readability and possibly have no effect on performance.</span><span>
</span>
4 0
2 years ago
Read 2 more answers
Which is a major drawback of muliuser procesing of a database
-BARSIC- [3]

The main drawback of multiuser processing of a database is:

  • Lost-update problem.

<h3>What is  lost-update problem?</h3>

In the area of lost update problem, an update that has been carried on to a data item by a transaction is said to be lost as it is known to be overwritten by the update that has been carried on by another transaction.

Therefore, The main drawback of multiuser processing of a database is:

  • Lost-update problem.

Learn more about database from

brainly.com/question/26096799

#SPJ12

3 0
2 years ago
Other questions:
  • How long does it take to wire a house?
    14·2 answers
  • To easily add an organizational chart to a document, users should select _____. SmartArt Text Boxes Shapes Clip Art
    8·2 answers
  • A resistor bank is connected to a controller with conductor insulation rated 75 °C. The resistors are not used in conjunction wi
    15·1 answer
  • Select two netiquette guidelines. In three to five sentences, explain why these guidelines make professional online communicatio
    15·2 answers
  • Kelly is a college sophomore majoring in computer science. She is interested in gaining exposure to the most useful and current
    13·1 answer
  • You are driving on expressway with three lanes in your direction at a speed lower then
    8·2 answers
  • What do you like and dislike about school? ANDWER FAST!!!
    5·2 answers
  • What is not true of efs
    11·1 answer
  • Kelly is a college sophomore majoring in computer science. She is interested in gaining exposure to the most useful and current
    14·1 answer
  • How do you invite someone to a conversation on brainly
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!