Groups
Groups
Sign in
Groups
Groups
姚博士的论坛-教学
Conversations
About
Send feedback
Help
一个关于paint的问题和解答
2 views
Skip to first unread message
maomao
unread,
Apr 8, 2008, 9:35:03 PM
4/8/08
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to 姚博士的论坛-教学
应该使用一个Vector对象保存所画过的图形,每次paint时,先从Vector中取出以前所画的所有图形,然后再画新的图形。
2008-04-09
--------------------------------------------------------------------------------
Dr. Yao Yu
--------------------------------------------------------------------------------
发件人:
发送时间: 2008-04-09 09:26:16
收件人:
抄送:
主题: java
姚老师:
你好!又要麻烦你了。我在利用paint绘图的时候,为什么用循环的方式绘制时只出现一个图形呢,
例如:public void paint(Graphics g)
{
for(int i=0;i<8;i++)
g.drawLine (100+i*10,100+i*10,200+i*10,200+i*10);
}
显示的时候只出现一条线,而且放在线程当中也不管用。我找不到原因,而且图像存起来后不能利用循环的方式绘制出来。
谢谢老师!
Reply all
Reply to author
Forward
0 new messages