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
The act of engaging in crime through the use of a computer or similar type of device is called:
marin [14]
I don’t have an explanation for why it is called this, because really the name of it is in its definition. The two words this sentence describes are cybercrime and computer crime. They are both the same thing.
8 0
3 years ago
Please help me idk I suck at this stuff ​
kap26 [50]
I would say the best clear answer is D, because A is a little bit unclear but I would say the best answer is D.

Why?

Mesh Topology is expensive considering more links as compared to Ring topology.


4 0
2 years ago
Cómo se puede evitar que desparescan los recursos de la zona de Michoacán
Aliun [14]
This should be put in the Spanish section <span />
8 0
3 years ago
Help<br> pls need quickly
g100num [7]

Answer:

Themes

Explanation:

  1. In the slide thumbnail pane on the left, select a slide.
  2. On the Design tab, in the Themes group, click the More button (illustrated below) to open the entire gallery of themes:
  3. Point the mouse at the theme you want to apply. Right-click it, and then select Apply to All Slides.
3 0
2 years ago
Social media tools allow you to connect with people anywhere in the world who share your interests evaluate your interactions wi
babymother [125]

The social media tools that you used to form these connections are:

  • Buzz Sumo.
  • Go ogle Trends.
  • Buffer Publish.
  • Can va.
  • Un splash

<h3>What are social media tools?</h3>

Social media tools are known to be key tools that are used for the running of business so as to handle important ways in their Digital Marketing routine.

The social media tools are important because it helps one to plan ahead and also  ensure that a person post the type of content needed to reach your goals and grow one's business.

Learn more about  social media from

brainly.com/question/3653791

5 0
2 years ago
Other questions:
  • Let's say you're creating a search stream in your hootsuite dashboard, to find mentions of the phrase vacation holiday getaway.
    15·1 answer
  • _________ is critical to Amazon's success.<br><br> SCM<br><br> JIT<br><br> ERP<br><br> VMI
    9·1 answer
  • Hiiiiiiiiiii hiiiiiiiiiiiiiiiiiii
    9·2 answers
  • write the cell address for the following 1. First row and first column 2.First column and last row. 3. 10th column and 19th row.
    5·1 answer
  • Can someone please give me timetable managment system with data structures in java?
    11·2 answers
  • Hoda is creating a report in Access using the Report Wizard. Which option is not available for adding fields using the wizard?
    15·2 answers
  • Which of the following is not true about variables
    8·1 answer
  • What is the main function of the output on a computer or what is it use for? ​
    15·2 answers
  • what is a program or collection of programs that enable a person to manipulate a visual images on a computer​
    14·1 answer
  • Computers that are joined together are called networks true or false
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!