Tue Nov 11, 2008 8:45 pm
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.awt.geom.*;
public class DrawAnArc extends JApplet {
BasicStroke basicStroke = new BasicStroke(5.0f);
public void paint(Graphics g) {
Graphics2D g2d = (Graphics2D) g;
g2d.setPaint(Color.red);
g2d.setStroke(basicStroke);
g2d.draw(new Arc2D.Double(5, 10, 150, 150, 60, 150,
Arc2D.OPEN));
}
public static void main(String s[]) {
JFrame frame = new JFrame("Draw Arc");
JApplet applet = new DrawAnArc();
frame.getContentPane().add("Center", applet);
frame.setSize(300, 250);
frame.show();
}
}
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.