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
The following are part of characteristics of a software requirement specification.
marusya05 [52]

Answer:

should there be 'except' in the question?

6 0
3 years ago
What is earning potential?
Natalka [10]

Answer:

Earning potential often refers to the top salary for a particular field or profession. In the finance world, the meaning is not much different: earning potential is the biggest profit a company could potentially make.

Explanation:

Earning potential often refers to the top salary for a particular field or profession. In the finance world, the meaning is not much different: earning potential is the biggest profit a company could potentially make.

4 0
3 years ago
Creating a newsletter
pav-90 [236]
This isn’t helpful considering no one knows what type of news letter you want
6 0
2 years ago
Match the element of a presentation program to its description
lana [24]

Answer:

A) Array of buttons for<u> quick access </u>to commonly used <u>commands and tools</u>: Tool bar

That's what most people will use most of the time, to quickly perform the most common tasks.

B) <u>List of commands</u> to create, format and edit presentations: Menu Bar.

When the features listed in the tool bar aren't enough, we go to the Menu system, which lists all the features of the program.

C) <u>Provides info</u> about current slide<u> at the bottom</u> of the slide: Status Bar.

The status bar is always located at the <u>bottom of the screen</u>.

D) <u>Provides navigation</u> through the slides: Scroll bar.

Where you can scroll down and up your slides.

4 0
3 years ago
Can someone help me plz
xxMikexx [17]

Answer:

ok but on what tho

Explanation:

plz explain yourself

8 0
3 years ago
Read 2 more answers
Other questions:
  • Which of the following is NOT something you can specify in the bullets and numbering dialog box?
    8·1 answer
  • Complete the paragraph describing characteristics of an audio mixer
    8·2 answers
  • Choose a film you have watched, or watch a film you have wanted to. Write a film review in at least three paragraphs. Describe w
    5·1 answer
  • A simulation model includes: a. a description of the components of the system. b. a simulation clock. c. a definition of the sta
    8·1 answer
  • A browser is used for creating Web pages. true or false?
    5·2 answers
  • Write an algorithm to solve general formula? ​
    10·1 answer
  • Write if true or false
    12·1 answer
  • Which tab on the Ribbon contains the command to print a publication?
    10·1 answer
  • What are Database administrators? <br> Thank you :)
    7·1 answer
  • what is the term for software that is exclusively controlled by a company, and cannot be used or modified without permission?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!