only complete the methodQuestion 3: (a) Write the paintComponent() method below that draws an Italian flag, as shown on the right (where the three colors are green, white, and red). The three rectangular areas must be of equal size and the flag must fill the window frame, even after resizing. (5 marks) 4 public class Flag Demo extends JPanel public void paintComponent( Graphics g){ Grophics 2D (Grapnics2b) 9 2. getvidth 3 int rect Wcth Color GaeEu) Show transcribed image text Question 3: (a) Write the paintComponent() method below that draws an Italian flag, as shown on the right (where the three colors are green, white, and red). The three rectangular areas must be of equal size and the flag must fill the window frame, even after resizing. (5 marks) 4 public class Flag Demo extends JPanel public void paintComponent( Graphics g){ Grophics 2D (Grapnics2b) 9 2. getvidth 3 int rect Wcth Color GaeEu)
Expert Answer
Answer to Question 3: (a) Write the paintComponent() method below that draws an Italian flag, as shown on the right (where the thr…