c*******a 发帖数: 29 | 1 想一个panel做控制area,
一个做draw area,
大虾给个code做参考吧,
我现在一paint就吧整个ContentPane给覆盖了
看不见control area了。 |
xt 发帖数: 17532 | 2
你到底说的是什么意思,看不懂.请贴foto先,然后再研究code. hehe
【在 c*******a 的大作中提到】 : 想一个panel做控制area, : 一个做draw area, : 大虾给个code做参考吧, : 我现在一paint就吧整个ContentPane给覆盖了 : 看不见control area了。
|
c*******a 发帖数: 29 | |
c*******a 发帖数: 29 | 4 好像查到应该是做一个drawArea 的class extends JPanel
然后里面定义paint();
这样画的图就只覆盖drawArea了。
昨天开始正式写java GUI,
难免有点笨啦。
【在 c*******a 的大作中提到】
|
B******N 发帖数: 445 | 5 better override paintComponent(Graphics g)for swing。
when buttonclick you need call repaint()
【在 c*******a 的大作中提到】 : 好像查到应该是做一个drawArea 的class extends JPanel : 然后里面定义paint(); : 这样画的图就只覆盖drawArea了。 : 昨天开始正式写java GUI, : 难免有点笨啦。
|
xt 发帖数: 17532 | 6
I would override update() for better control
【在 B******N 的大作中提到】 : better override paintComponent(Graphics g)for swing。 : when buttonclick you need call repaint()
|
B******N 发帖数: 445 | 7 interesting, never heard it. Could you give some weblink or tutorials about
this? or code examples from authrized source? I never read any souce code from
sun use this way. Probably i read less or my knowlege is less.
【在 xt 的大作中提到】 : : I would override update() for better control
|