Topic: 窗口改变,画的线不见了

  Print this page

1.窗口改变,画的线不见了 Copy to clipboard
Posted by: aaaaal
Posted on: 2004-12-24 22:17

用语句 Graphics g = jPanel1.getGraphics();

g.drawLine(x1,y1,x2,y2);

当双击或是最大最小化后,画的线就不见了
怎么办啊

2.Re:窗口改变,画的线不见了 [Re: aaaaal] Copy to clipboard
Posted by: kavinwang
Posted on: 2004-12-24 22:21

应该重新定位:)

3.Re:窗口改变,画的线不见了 [Re: kavinwang] Copy to clipboard
Posted by: aaaaal
Posted on: 2004-12-24 23:00

具体一点好码
我是新手啊

4.Re:窗口改变,画的线不见了 [Re: aaaaal] Copy to clipboard
Posted by: 卡克洛奇
Posted on: 2004-12-27 21:36

好像你不应该主动去画而应该在paintComponent里面作图。。。实在需要刷新的时候repaint,这样会确保使用正确的Graphics参数作图的。。。


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923