Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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:
. 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 ResetStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started