I created class NewProject extends JInternalFrame. Then I create New...Action named "NEW", localised in File menu. I put code NewProject p = new NewProject(); p.setVisible(true);
to the ActionPerformed method of the action.
But when I run the module and click "NEW" in file menu, nothing appears.
Where can be problem?
EDIT:
I partially solved it by code:
public void actionPerformed(ActionEvent e) {
JInternalFrame f = new JInternalFrame();
f.setSize(500, 500);
f.setVisible(true);
JDesktopPane p = new JDesktopPane();
p.add(f);
//WindowManager.getDefault().getMainWindow().setTitle("fFF");
WindowManager.getDefault().getMainWindow().add(p)
}
but GUI is broken. When I create new internal frame, the black background appears as I move by that frame.
Any idea how to solve it?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…