Netbeans MDI - Hide InternalFrame

View: New views
1 Messages — Rating Filter:   Alert me  

Netbeans MDI - Hide InternalFrame

by heidiweber :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

first of all: i´m a newbie in Netbeans GUI Programming (Swing). I work with Java 6 (1.6.0_04) and Netbeans

6.1.

Yesterday i tried to create a litle MDI-Application and what a surprise - it was really easy. So i delete

the project and created a new one with the same properties. But no i have a problem.

Here what i did:

1)
New -> New Project

2)
Java -> Java Desktop Application

3)
Basic Application

-> The Project is created.

Because i want a MDI-Project i put "Desktop Pane" with Drag&Drop onto the mainPanel (JPanel).

After that i put a "InternalFrame" onto the "Desktop Pane".

Now i want a menu with 2 items. One for closing the InternalFrame and one for opening the InternalFrame.

So i created 2 menuitems and assigned 2 actionEvents->actionPerformed.

In the close-Menu i put the code:
jInternalFrame1.hide();


In the open-menu i put the code:
jInternalFrame1.show();


That was it. So i run the project. And if i click the menuitem to close the form, first of all nothing is

happening. But when i resize the main-form (mainpanel) with the mouse - the internalframe is blanked out.

When i click the menuitem to show the internalframe - everything is working fine.

But in my first project this was working. I can´t remember that i made anything else. What made i wrong?

Where is my mistake?

My project looks like:


Can someone help me please?

Best regards
Heidi