62,615
社区成员
发帖
与我相关
我的任务
分享
public class myPanel extends JPanel {
JPanel pnl1 = new JPanel();
...
...
/**
* 增加控件的方法
*/
public void addPanel() {
add(pnl1);
updateUI();
}
/**
* 移除控件的方法
*/
public void removePanel() {
remove(pnl1);
updateUI();
}
}