JInternalFrame上为什么JPanel和JInternalFrame不能同时显示
public FunctionFrame(String title) {
desktop = new JDesktopPane();
this.getContentPane().add(desktop);
setTitle(title);
setResizable(false);
setClosable(true);
setIconifiable(true);
setBounds(FRAME_X,FRAME_Y,FRAME_WIDTH,FRAME_HEIGHT);
this.setVisible(true);;
this.getContentPane().add(new AccountPanel());
// InfoFrame info = new InfoFrame("");
// desktop.add(info);
// info.setVisible(true);
}
InfoFrame和FunctionFrame继承了JInternalFrame,如果去掉注释,InfoFrame显示不出来,再把增加JPanel的代码注释掉才能显示。这是为什么?怎么解决呢?