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]
4 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]4 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
Explain online issue management​
Over [174]

Answer:

Online issue tracking system is a computer software solution for managing issues lists. The lists of issues are defined by the organization activity field.The best example of online issue tracking software is a customer support call center. ... A Bug Tracker is also one of possible online issue tracking software

Explanation:

the answer has the explanation needed.

7 0
3 years ago
50PTS!! does anyone know how you turn in a section of your slides my teacher wants us to turn in only a portion of our google sl
HACTEHA [7]

Answer:

The best way to turn in one part of google slides, since you can't split the slide when turning assignments on classroom, is to copy and paste the part you want to turn in into another slide and submit that portion. I've done for many projects before and if you name the different slides (Ex: Assignment Portion One 5/6/20) so it won't get confusing with the multiple slides.

This is the best way I can think of, I hope I helped, and please correct me if there is a better way!

5 0
4 years ago
When it comes to social media technologies and formal learning in the corporate environment, the only social media platform that
Andrew [12]

Ootions: TRUE OR FALSE

Answer: FALSE

Explanation: According to (Steer,2015) there are many platforms for learning and teaching purposes in corporate Organisations, they include PINTEREST,WIKI,GOOGLE+, LINKEDIN,TWITTER etc, The social media platforms are available for effective and efficient Communication and has been the main driving force for Businesses the world over.

These social media platforms have aided the growth and expansion of product marketing strategies and enhanced the over all business efficiency.

4 0
3 years ago
What the heck is happening what is this?
Brilliant_brown [7]
Just decrease the font size and the size of the like will decrease.

Decrease font size by pressing on the part were it says 29 and typing in a smaller number like 14 for example
4 0
3 years ago
Before you create a pivot table, it is important to __.
Reptile [31]

Before you create a pivot table, it is important to <em><u>Create a database</u></em>.

Option: A

<u>Procedure to create Pivot Table: </u>

1. Select the cells and table in the sheet containing the data you want to use.

2. Go to the Insert tab and click the PivotTable command.

3. In the dialog box ‘Create PivotTable’ will appear. Choose your settings, then click OK. In our example, we will use Sheet1 as our source data and insert the PivotTable on a new worksheet.

4. The Field List and blank PivotTable will appear on a new worksheet.

5. Once you create a PivotTable, you have to decide which fields to add. Each field has a simple column header from the source data. In the PivotTable Field List, check the box for each field you want to add.  

6. The selected fields will be added to one of the four areas below the Field List. In our example, the Salesman field has been added to the Rows area, while the Order Amount has been added to the Values area. Alternatively, you can click, hold, and drag a field to the desired area.

7. The PivotTable values will calculate and summarize the selected fields. In our example, the PivotTable shows the amount sold by each salesman.

8 0
3 years ago
Read 2 more answers
Other questions:
  • Ally typed a business letters she most likely used a
    5·1 answer
  • If you write a toString method to display the contents of an object, object1, for a class, Class1, then the following two statem
    14·1 answer
  • Stella is surfing the Internet to look for affordable apartments in New York City. Every time she clicks on a link to a webpage,
    9·1 answer
  • man who is colorblind marries a woman who has normal color vision and is not a carrier of color blindness. If this couple has a
    15·1 answer
  • how write a program to prompt the user for hours and rate per hour using input to computer gross pay Use 35 hours and rate2.75 p
    9·1 answer
  • What do you think is the most fascinating aspect of the internet?
    7·2 answers
  • Write an algorithm that accepts two numbers,
    7·1 answer
  • . Write a C++ Code to get a multiline statement Str1 from a user with a ‘$’ as return character (Hint:
    6·1 answer
  • TRUE OR FALSE: THE BUILDER'S CLUB IS A PAID SUBSCRIPTION.
    9·2 answers
  • Please help me on this it’s due now
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!