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
Lostsunrise [7]
3 years ago
9

The following program draws squares recursively. Fill in the missing code. import javax.swing\.\*; import java.awt\.\*; public c

lass Test extends JApplet { public Test() { add(new SquarePanel()); } static class SquarePanel extends JPanel { public void paintComponent(Graphics g) { super.paintComponent(g); int width = (int)(Math.min(getWidth(), getHeight()) * 0.4); int centerx = getWidth() / 2; int centery = getHeight() / 2; displaySquares(g, width, centerx, centery); } private static void displaySquares(Graphics g, int width, int centerx, int centery) { if (width >= 20) { g.drawRect(centerx - width, centery - width, 2* width, 2 * width); displaySquares(________, width - 20, centerx, centery); } } } }
Computers and Technology
1 answer:
ExtremeBDS [4]3 years ago
8 0

Answer:

The missing code to this question is g.

Explanation:

In this question firstly import packages. Then declaration of the class Test that inherits the JApplet. In this class, we declare the default constructor. In this constructor, we call the add function. Then we declare another class that is SquarePanel. This class inherits JPanel. In this class, we define a method that is paintComponent(). In this method, we define an integer variable. In this method, we perform calculations and pass it to another function that is displaySquares(). In this function, we pass the value as the arguments. So in question the missing code or argument is g.

You might be interested in
why does it not let me create a new account when i log out of this one and go to join now after i fill everything out it wont le
frozen [14]
Try linking an email to your account, if it doesn’t work select forgot your password and you should receive an email where you can re make or change your password to something easier to remember. Are you using the same email account every time, this may also be the reason, if it is the same email they will not allow you to reuse it and it should tell you the email is already in use. Hope this helped
5 0
3 years ago
Which statement is true about the elements of the interface of a presentation program?
Anton [14]
<span>C. Rulers indicate the margins, tabs, and indents in a presentation slide.
</span>
6 0
3 years ago
Read 2 more answers
Assume that you are working with spreadsheets, word processing documents, presentation slides, images, and sound files for a sch
dybincka [34]

Answer:

See explanation below.

Explanation:

File organization is very important especially when one is working with numerous files from different applications.

When you are working with spreadsheets, word processing documents, presentation slides, images and sound files, it is important to create folders and sub-folders to make locating your files a lot easier.

  1. Make sure you have all your files saved with names that are relevant to your school project.
  2. Create a sub-folder to store all spreadsheets files, create a sub-folder to store all word processing files, create a sub-folder to store all presentation slides and create another folder to store images and sound files. You do this to make it easy for you to locate whichever file you want.
  3. You create the sub-folder by right clicking on your documents section and clicking on new folder. Type in the name of the folder and save.
  4. After creating sub-folders,  create a general folder for all your folders by using the same method in step 3. Copy all your sub-folders into this major folder. You can name this folder the name of your school project.

This way, you never have to look for any files for your school project.

6 0
2 years ago
What type of machine is the energy of a seismic wave recorded?
Sloan [31]
<span>the answer is most likely "Seismograph"</span>
7 0
3 years ago
What is the name that is given to a symbiotic relationship in which both species benefit?
avanturin [10]
Mutualism.
An example of mutualism is where insects pollinate plants, then the plants provide nectar.
7 0
3 years ago
Read 2 more answers
Other questions:
  • In dt.py, you will implement a basic decision tree classifier for
    5·1 answer
  • The HR department of a company wants to send out an email informing its employees about an upcoming social event. Which email ap
    11·2 answers
  • Whats the difference between search engine and web browser?
    6·2 answers
  • Press the _______ key to move to the next cell in a row.
    5·1 answer
  • In a distributed database system, the data placement alternative with the highest reliability and availability is Group of answe
    9·1 answer
  • How we know that how many domain exist in window server 2012?
    14·1 answer
  • Which type of loan is based on financial need
    6·1 answer
  • What makes these Pokémon special?
    9·2 answers
  • Simplify 0.2×0.03055 to 3 decimal places​
    15·2 answers
  • What is the nearest ten cents of 453.56
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!