Ale*_*lex 3 java graphics swing jpanel
制作这个画笔程序我决定要清除面板容器(panel2在链接代码中).我使用过PanelName.setForeground(null)它.我想知道的是,这种方法是否存在已知的缺点以及从容器中删除图形对象的其他方法.
panel2
PanelName.setForeground(null)
mre*_*mre 5
如果覆盖paintComponent,则可以清除其Graphics使用Graphics#clearRect.但总的来说,我更喜欢你的方法,因为我会要求你要么是子类JPanel,要么匿名声明一个.
paintComponent
Graphics
Graphics#clearRect
JPanel
归档时间:
13 年,3 月 前
查看次数:
1052 次
最近记录: