import java.awt.*;
import java.awt.geom.*;
public class DrawingTest extends Frame {
Shape shapes[] = new Shape[4];
public DrawingTest (String title) {
super(title);
setSize(500, 400);
drawShapes();
add("Center", new MyCanvas());
}
public static void main(String args[]) {
DrawingTest app = new DrawingTest("Drawing test");
app.show();
}
void drawShapes () {
shapes[0] = new Rectangle2D.Double(12.0,12.0, 98.0, 120.0);
shapes[1] = new Ellipse2D.Double(150.0, 150.0,90.0,30.0);
shapes[2] = new RoundRectangle2D.Double(200.0, 25,
235.0, 250.0, 50.0, 100.0);
GeneralPath path = new GeneralPath(new Line2D.Double(100.0,
350.0, 150.0, 300.0));
path.append(new Line2D.Double(150.0, 300.0,
200.0, 350.0), true);
path.append(new Line2D.Double(200.0, 350.0,
250.0, 300.0), true);
path.append(new Line2D.Double(250.0, 300.0,
300.0, 350.0), true);
shapes[3] = path;
}
class MyCanvas extends Canvas {
public void paint(Graphics graphics) {
Graphics2D gr = (Graphics2D) graphics;
for (int i=0; i<4; i++)
gr.draw(shapes[i]);
}
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
21天学通c语言(第6版)----代码
共418个文件
c:191个
exe:167个
java:25个
4星 · 超过85%的资源 需积分: 10 81 下载量 41 浏览量
2008-06-26
15:12:45
上传
评论
收藏 705KB RAR 举报
温馨提示
21天学通c语言(第6版)----代码
资源推荐
资源详情
资源评论
收起资源包目录
21天学通c语言(第6版)----代码 (418个子文件)
hello.aspx 508B
week2.c 7KB
week3.c 6KB
linklist.c 6KB
week1.c 5KB
Coder.c 3KB
ptrsort.c 2KB
menu2c.c 2KB
menu2.c 2KB
printf.c 2KB
fseek.c 2KB
count_ch.c 2KB
sort.c 2KB
ListD03.c 1KB
menu.c 1KB
times.c 1KB
linkdemo.c 1KB
scanit.c 1KB
ptrmulti.c 1KB
getint.c 1KB
scanf.c 1KB
ftell.c 1KB
struct.c 1KB
strsort.c 1KB
copyit.c 1KB
typecast.c 1KB
sort.c 1KB
direct.c 1KB
find_nbr.c 1KB
union2.c 1KB
ListD06.c 1KB
malloc.c 1KB
escape.c 1KB
free.c 1KB
fopen.c 1KB
random.c 1KB
ListD05.c 1KB
fprintf.c 1KB
ListD04.c 1KB
sizeof.c 1KB
ListD07.c 1KB
passptr.c 1018B
mem.c 1011B
print_it.c 992B
print_it2.c 984B
vary.c 980B
ListD01.c 972B
ListD02.c 971B
mortgage.c 967B
passing2.c 954B
fallthru.c 933B
func.c 929B
memalloc.c 920B
strucarr.c 912B
array.c 911B
const.c 910B
arraysize.c 909B
access.c 907B
Ex08_08.c 893B
seconds.c 861B
list_it.c 860B
switch2.c 841B
ptr2.c 840B
passing.c 835B
cont.c 828B
realloc.c 802B
grades.c 788B
new_time.c 778B
asize.c 773B
Ex10_05.c 764B
test.c 762B
strcpy.c 760B
union.c 755B
ptr_math.c 739B
seconds.c 736B
args.c 708B
do.c 693B
clearing.c 659B
recurse.c 652B
upper2.c 649B
multiply.c 644B
feof.c 632B
whiles.c 628B
return.c 620B
putchar2.c 620B
Ex09_07.c 619B
strchr.c 619B
List0406.c 611B
List0502.c 608B
strcmp.c 593B
ptr.c 575B
gotoIt.c 574B
expenses.c 573B
switch.c 570B
strcspn.c 570B
Ex09_09.c 567B
nums.c 567B
List0404.c 565B
clear.c 558B
strspn.c 555B
共 418 条
- 1
- 2
- 3
- 4
- 5
资源评论
- Champagne-lyb2014-01-03说实话C语言靠21天真的只是仅仅知道,那是C语言而已。
- 懒家大少2013-09-22发现网上的都是模糊版,怎么就没有清晰版呢?不过也谢谢贡献!
imxlw00
- 粉丝: 622
- 资源: 53
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功