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
The term platform as a service has generally meant a package of security services offered by a service provider that offloads mu
Stells [14]

Answer:false

Explanation:

8 0
3 years ago
A benefit of IPsec is __________.
Montano1993 [528]

Answer:

Option (4) is correct answer

Explanation:

IPsec stands for Internet protocol security. It is a protocol that works between two communication points. It provides integrity, confidentiality and data authentication for any network. It is used for Virtual private network.  There are two types of VPN, From which an organization needs to choose one.

IPsec and OpenSSl in which IPsec VPN uses IP security.

Benefits of this network are as follows--

  • Option 1 states that it works after the transport layer which is true.
  • Option 2 states that when any user leaves the organization they have no need to take back the martial which he had already provided to the organization which is also the benefit of IPsec.
  • Option 3 states that it provides security that is also correct because it is a protocol that is designed to provide security.

Hence option D (all of the above ) are correct.

3 0
3 years ago
What protocol allows us to use a domain name like .com instead of an ip address?
san4es73 [151]
The answer is DNS (Domain Name System)

IP addresses are difficult to remember and therefore, the internet allows you to specify a computer using a host name. The same case happens to DNS. It maps domain names to IP addresses. Domain names are alphabetic making them easier to remember.



4 0
3 years ago
Access 1.04 knowing your audience
luda_lava [24]

Answer:

What?

Explanation:

I would like to help, but what is the question

4 0
4 years ago
National Computer Corporation (NCC) employs Cynthia as an agent. NCC gives her an exclusive territory in which to sell NCC produ
LuckyWell [14K]

Answer:

The answer is cooperation

Explanation:

National Computer Corporation (NCC) employs Cynthia as an agent. NCC gives her an exclusive territory in which to sell NCC products. NCC cannot compete with her in that territory under the duty of cooperation

8 0
4 years ago
Other questions:
  • What are some examples of objects by which you can browse in the select browse option
    6·1 answer
  • Assume you had a .csv file with data already populated that you wanted to use for a mail merge. Which button would you press to
    8·1 answer
  • List two reasons why buying a computer is no easy task?
    7·1 answer
  • A user found that their personal data had been exfiltrated from their computer by a malicious program that they clicked on sever
    12·1 answer
  • Peter wants to protect a confidential document by using a password. He wants to use an asterisk and an ampersand symbol in his p
    10·1 answer
  • Excel allows you to rotate text in a cell counterclockwise by entering a number between -1 degrees and -90 degrees. True or fals
    14·1 answer
  • Which sentence(s) below are true?a. IP stands for Internet Protocol.b. In most home networks IP addresses are assigned by the In
    6·1 answer
  • HELP PLSS‼️ Which are the following are considered peripherals? Mark all that are correct
    11·1 answer
  • Freee poiiiiintttttssss​
    14·2 answers
  • Inappropriate use of technology makes it easier for cyber bullies to <br> others.
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!