Question 4.
4. (T Cos 1–8) Start from the given class, and create a New Panel class to draw a figure like below: (Need about 15 lines)
import java.swing.*;
import java.aw.Color;
import
java.aw.Graphics;
public class draw Sun extends
J Frame {public draw Sun() {add(newspaperman());}public static void main(String[] rags) {drawSun frame = new draw Sun();frame.set Title(“Sun”);
frame.set Size(200, 200);
frame.nonrepresentational(null); // Center the frame
frame.noncooperation(J Frame.EXIT_ON_CLOSE);
frame.set Visible(true);
The circle coordinate and size is (70, 60, 40, 40)
The text coordinate is: (80, 85)
The starting and ending lines coordinate are
(120, 80, 134, 80)
(110, 60, 120, 50)
(90, 36, 90, 50)
(60, 50, 70, 60)
(46, 80, 60, 80)
(60, 110, 70, 100)
(90, 110, 90, 124)
(110, 100, 120, 110).
Color orange, with text color red. (Points : 20)