两个小问题,急,在线等

1982fish 2004-12-24 07:59:36
1、怎样画一个从 a(x1,y1)指像b(x2,y2)的箭头~?
2、怎样在 c(x3,y3)上画一个点?并用参数可以改变其大小

江湖救急了~~大侠们~
...全文
91 9 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
iwenlong 2004-12-25
  • 打赏
  • 举报
回复
覆盖的话,要在paintComponent方法一开始调用super.paintComponent确保绘制顺序
莫情莫钱 2004-12-25
  • 打赏
  • 举报
回复
学习
1982fish 2004-12-25
  • 打赏
  • 举报
回复
多谢congcat(网破鱼欢)
还有个问题问大家,本来我的窗口有一些输入框,按钮之类的东西,用
drawLine(int x1, int y1, int x2, int y2) 画一条直线后,就都被覆盖了(就像放上了一张画有一条直线的灰色的纸)然后随便点到哪个控件,哪个上面的“纸”就破了看到下面的控件
我想画的线是在运行某些东西后填上去的,有什么办法让我只填加一条线,而不要那个灰色的背景?

还有,JAVA 里可不可以指定像 PANEL 那样的控件,在里面画图,并且坐标的值也是根据在 PANEL 的对位置来算而不是相对原来那个窗口
1982fish 2004-12-25
  • 打赏
  • 举报
回复
问题解决了,谢谢各位
lsrj 2004-12-24
  • 打赏
  • 举报
回复
学习
classjava 2004-12-24
  • 打赏
  • 举报
回复
^_^其它跟楼上一样箭头用">" 这个字符串
jFresH_MaN 2004-12-24
  • 打赏
  • 举报
回复
1 - 画直线还行!箭头就不会了。
2 - 是不是画一个填充圆呀??
愤怒的不争 2004-12-24
  • 打赏
  • 举报
回复
画直线 drawLine(int x1, int y1, int x2, int y2)

Parameters:
x1 - the first point's x coordinate.
y1 - the first point's y coordinate.
x2 - the second point's x coordinate.
y2 - the second point's y coordinate

画空心圆 drawOval(int x, int y, int width, int height)
实心圆 fillOval(int x, int y, int width, int height)

Parameters:
x - the x coordinate of the upper left corner of the oval to be filled.
y - the y coordinate of the upper left corner of the oval to be filled.
width - the width of the oval to be filled.
height - the height of the oval to be filled.
愤怒的不争 2004-12-24
  • 打赏
  • 举报
回复
1 - 画直线还行!箭头就不会了。
2 - 是不是画一个填充圆呀??

62,635

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧