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
Drag the tiles to the correct boxes to complete the pairs.
Gala2k [10]

Answer:

So the first one i think is A. The second is 2, and that i do know

Explanation:

6 0
3 years ago
How would a programming language that allows programs to run on any operating system be classified?
Illusion [34]
Cross-platform.





--------------------
3 0
3 years ago
In Windows Explorer, the opposite of expanding a folder is a what
Tomtit [17]
The opposite of expanding a folder is Collapsing a folder. Hope I helped :)
3 0
3 years ago
If anyone plays pokemon go put your code below.
Cerrena [4.2K]
Yeah my pokémon is not my mom hung bye
4 0
2 years ago
Read 2 more answers
Write an application that prompts a user for a month, day, and year. Display a message that specifies whether the entered date i
gizmo_the_mogwai [7]

Answer:

Following is given the code with all necessary description given as comments in it. I hope it will help you!

Explanation:

4 0
3 years ago
Other questions:
  • What is a Limited Purpose credit card
    11·2 answers
  • The first widely adopted windows product, ____, featured a standardized look and feel, similar to the one made popular by apple'
    11·1 answer
  • 18) choose which article title would most likely be described by the database subject headings victims of famine, ireland, histo
    14·1 answer
  • In UNIX, how do I set the permissions on MyProgram.py to: rwx---r-x?
    7·1 answer
  • Syntax errors ________. a. result from an attempt to perform an operation that cannot executeb. are errors such as misspelled ke
    14·1 answer
  • A network administrator for a small company is contemplating how to scale the network over the next three years to accommodate p
    13·1 answer
  • Fifty part-time students were asked how many courses they were taking this term. The (incomplete) results are shown below. Need
    6·1 answer
  • Woah my favorite character got arrested
    10·2 answers
  • 1. Why do you need to take care of your computer? (Remember: Answer must include 3-5 sentences.)
    13·1 answer
  • Accessibility is the degree to which a product or service is readily available and usable by _____.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!