Question: package org.example; import javax.swing. * ; import java.awt. * ; import java.awt.geom. * ; public class Main extends JComponent { protected void paintComponent ( Graphics

package org.example;
import javax.swing.*;
import java.awt.*;
import java.awt.geom.*;
public class Main extends JComponent {
protected void paintComponent(Graphics G)
{
Graphics2D g2d =(Graphics2D) G;
g2d.setColor(Color.RED);
g2d.setStroke(new BasicStroke(3));
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2d.setColor(Color.GREEN);
g2d.fill(new CubicCurve2D.Double(643,228,659,334,640,674,194,583));
g2d.fill(new CubicCurve2D.Double(643,228,600,306,48,170,194,583));
g2d.setColor(Color.BLACK);
g2d.draw(new CubicCurve2D.Double(643,228,
659,334,
640,674,
194,583));
g2d.draw(new CubicCurve2D.Double(643,228,
600,306,
48,170,
194,583));
g2d.draw(new CubicCurve2D.Double(643,228,
628,403,
218,293,
194,583));
}
public static void main(String[] args){
int w =800;
int h =800;
JFrame Frame = new JFrame("Leaf in Hermite !!!");
Frame.getContentPane().setBackground(Color.white);
Frame.setSize(w, h);
Frame.add(new Main());
Frame.setLocationRelativeTo(null);
Frame.setVisible(true);
Frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
based on the prev draw me a Prophet's Dome of Masjid Nabawi

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 Programming Questions!