Question: Draw three rectangles inside each other, like this: . 5. Draw three rectangles inside each other, like this: Drawing Component.java 1 import java.awt.Graphics; 2 import

Draw three rectangles inside each other, like this:

Draw three rectangles inside each other, like this: . 5. Draw three

. 5. Draw three rectangles inside each other, like this: Drawing Component.java 1 import java.awt.Graphics; 2 import javax.swing.JComponent; mno 4 public class Drawing Component extends J Component public void paintComponent (Graphics g) g.drawRectangle (100, 100, 20, 30); // Innermost rectangle 10 } 11 } DrawingViewer.java 1 import javax.swing.*; public class DrawingViewer public static void main(String[] args) JFrame frame = new JFrame(); frame.setSize(300, 400); frame.setDefaultCloseOperation(JFrame.EXIT ON CLOSE); Drawing Component component = new Drawing Component(); frame.add(component); frame.setVisible(true); 17 } CodeCheck Reset

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!