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
ozzi
3 years ago
15

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. Assuming the existence of a Window class with existing methods, getWidth and getHeight, add the method getClientAreaHeight that returns the height (an integer) of the client area of the window.
Computers and Technology
1 answer:
Lady_Fox [76]3 years ago
4 0

Answer:

<u>Window.java</u>

  1. public class Window {
  2.    int width;
  3.    int height;
  4.    public Window(int width, int height){
  5.        this.width = width;
  6.        this.height = height;
  7.    }
  8.    public int getWidth(){
  9.        return width;
  10.    }
  11.    public int getHeight(){
  12.        return height;
  13.    }
  14.    public int getClientAreaHeight(){
  15.        return getHeight();
  16.    }
  17. }

<u>Main.java</u>

  1. public class Main {
  2.    public static void main (String [] args) {
  3.        Window win1 = new Window(12, 15);
  4.        System.out.println(win1.getClientAreaHeight());
  5.    }
  6. }

Explanation:

<u>Window.java</u>

There is a Window class with two int type attributes, width and height (Line 1 - 3).

The constructor of this class will take two inputs, width and height and set these input to its attributes (Line 5 - 8). There are two methods getWidth and getHeight which will return the value of attributes width and height, respectively (Line 10 - 16).

The required new method getClientAreaHeight is defined in line 18 -20. This method will call the getHeight method to return the height value of the window (Line 19).

<u>Main.java</u>

We test the Window class by creating one Window instance and call the getClientAreaHeight method and print the return output (Line 1 -6).

We shall see 15 is printed.

You might be interested in
Three homework questions I can't figure out, please help?
Burka [1]

It A

iT b

YOU CANT TRY THE TWO ONE THE WHO ARE WRITE

8 0
2 years ago
1. If you have the following device like a laptop, PC and mobile phone. Choose one device
ella [17]

Answer:

For this i will use my own PC.

OS - Windows 10

Storage Capacity - 512 GBs

Memory - 16 GB

Wi-Fi - Ethernet

Installed Application - FireFox

Explanation:

An OS is the interface your computer uses.

Storage capacity is the space of your hard drive.

Memory is how much RAM (Random Access Memory) you have

Wi-Fi connectivity is for how your computer connects the the internet.

An installed application is any installed application on your computer.

3 0
3 years ago
How to reload ingenuity when a pulsating blue thing is there
Hatshy [7]
Todo is very important
4 0
3 years ago
4.8% complete this is a single choice question; skip ahead to question content a b c d confirm difficulty level: moderate an int
PilotLPTM [1.2K]

Answer:

A replay attack

4 0
2 years ago
Sam plans to use this image in artwork for a brochure about airplanes. Which principles of page layout is Sam planning to use in
Fittoniya [83]

Answer: Alignment

Explanation:

The principle of repitition indicates that some aspect of a design are repeated. This can be in form of bullet list, lines, color etc.

Balance has to do with how the weight is distributed.

The Principle of Alignment means that the pictures on a page should be connected visually to another thing.

Principle of Proximity simoly means that the items that are related on a page should be close to each other.

Therefore, the principles of page layout that Sam is planning to use in this artwork is alignment.

6 0
2 years ago
Other questions:
  • An _________ is a phrase formed from the first letters of words in a set phrase or series of words a. Acronymic sentence c. Basi
    7·2 answers
  • When selecting text in word, holding down the ctrl key while clicking the mouse button will select the?
    15·1 answer
  • How does an agile team maintain requirement?​
    9·2 answers
  • I have a question on an IT crossword the question is as follows
    12·1 answer
  • Should a waiting thread receive priority over a thread first attempting to enter a monitor? What priority scheme, if any, should
    9·1 answer
  • The process of combining rows and columns in a table is called _____.
    8·1 answer
  • How do I delete my brainly account?<br> I don't need anymore.
    13·2 answers
  • Which game would you play info you were competitive?
    13·2 answers
  • First Computers and Technology question in 4 years..
    11·1 answer
  • System development life cycle
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!