import java.awt.*; import java.awt.event.*; import java.awt.geom.*; public class Cubic extends Frame{ Stroke drawingStroke = new BasicStroke(4); CubicCurve2D cubic= new CubicCurve2D.Double(40,150, 40, 05, 300, 350, 300, 180); public void paint(Graphics g){ Graphics2D ga = (Graphics2D)g; ga.setStroke(drawingStroke); ga.draw(cubic); } public static void main(String args[]){ Frame frame = new Cubic(); frame.addWindowListener(new WindowAdapter(){ public void windowClosing(WindowEvent we){ System.exit(0); } }); frame.setSize(310, 300); frame.setVisible(true); } }