文件名称:JavaD示例程序-JAVA课件scnu
文件大小:543KB
文件格式:PPT
更新时间:2024-05-16 03:13:54
JAVA 课件
Java2D示例程序 import java.awt.*; import java.applet.*; import java.awt.geom.*; public class Example extends Applet { public void paint(Graphics g) {g.setColor(Color.red) ; Graphics2D g_2d=(Graphics2D)g; QuadCurve2D curve_1=new QuadCurve2D.Double(2,30,80,55,20,90); QuadCurve2D curve_2=new QuadCurve2D.Double(2,30,5,67,20,90); QuadCurve2D curve_3=new QuadCurve2D.Double(2,30,54,67,20,90); g_2d.draw(curve_1);g_2d.draw(curve_2); g_2d.draw(curve_3);g_2d.fill(curve_3); }}