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]
4 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]4 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
What kind of firewall can block designated types of traffic based on application data contained within packets?
Bess [88]

Answer:

Content Filtering Firewall.

Explanation:

  • Content Filtering Firewall can block designated types of traffic based on application data contained within the packets.
  • This ensures that objectionable websites , web portals, emails containing objectionable material can be screened.
  • This blocks the access to that particular content.
  • This helps in keeping away Malware and secure the network and systems.
  • Both hardware and software can be used to implement the content filters.
4 0
3 years ago
Which of the following items in the folder window allows users to view locations which have been visited before?
Shkiper50 [21]
Previous locations arrow
8 0
3 years ago
What do y’all think are the pros and cons to using technology?
BigorU [14]

Answer:

Explanation:

pros. convenient, easy to use, and educational  cons. addictive, mentally draining, and creates a social divide.

7 0
3 years ago
The two internal networks are using the same internal network. Does this work? Why or Why not?
lana [24]

Answer:yes

Explanation:

They are the same network

3 0
3 years ago
Select all that apply. Purposes of writing include:
nalin [4]
All of these choices are reasons people write. they all appeal to different people
6 0
4 years ago
Read 2 more answers
Other questions:
  • You have recently implemented a new WAN technology to connect a remote branch office to your headquarters. While making VoIP cal
    15·1 answer
  • What does ADSL stand for?
    6·2 answers
  • Please help!!!!<br> Data means only facts. <br> A. TRUE B. FALSE
    14·1 answer
  • Explain how to implement two stacks in one array A[1..n] in such a way that neither stack overflows unless the total number elem
    7·1 answer
  • Explain the purpose of the frame check sequence (fcs) field in a data link frame trailer.
    7·1 answer
  • Which technological innovation was most important for early-nineteenth-century economic development?
    11·1 answer
  • Use the _____ and _____ features to prevent field columns from showing or to view two nonadjacent field columns for comparison.
    6·1 answer
  • ____ is one of the primary operations of a computer.
    10·1 answer
  • Access your Practice Lab titles Access your exercise content Reports and files Access your settings Access help and support Comp
    12·1 answer
  • Which device is used to direct the flow of data on a computer network?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!