I have this main-screen with buttons to lunch another sub-screen, I made the sub-screen set its layered pane to modal and it works fine the main-screen sit behind the sub-screen even though i clicked on it, but the only problem is i can still close, minimized and maximized the main-screen (that sit behind the sub-screen), and moreover i can also type on its JTextField components..., the point is i want to disable the whole frame (as in no mouse event) but i cant, i tried the setEnabled(false) but it dont work. please help me! thanks in advance.
What are the base classes for your main and sub frame? JFrame or JDialog? Anyway, both have a glasspane (getGlassPane()). If you set this to visible, then you are not able to click on any component or enter values. The glasspane is a pane, which sits on the top of any other component. The only thing, I don't know is if it sits also on the top of the three frame buttons to minimize, maximize and close. Hope, that this helps a bit
Your Topic Title speaks of JInternalFrames, yet you make no reference to actually using a JInternalFrame object. It sounds to me like you need to be using a JDialog. If you have a parent frame (JFrame) in which you want to open sub-frames and when these sub-frames open, you need your parent frame to be completely disabled while the sub-frame is open, then a JDialog is deffintally the way to go.
Ok, so let me get this straight. You have a JFrame using a JDesktopPane as the contentpane. On the JDesktopPane you have a JInternalFrame where you launch other JInternalFrames from?? Is this correct? And then you want that when you open your "sub-frames" from this JInternalFrame, the sub-frames stay on top? Again, JDialog would be the easiest to use. Or, you could always setVisible(false) on the Main InternalFrame while your sub frames are open then turn them back on when you lose your sub frames. I guess what I really don't understand is why, in your application, you are requiring that your JInternalFrame (Main Frame) launch other JInternalFrames (sub Frame) that are modal. JInternalFrames are not meant to act the way you want them to. You could probably dig deep in the UI and over-ride some methods to make it work, but that I don't know how to do.
Joined: May 02, 2002
I strongly agree with Gregg. JDialog is the best way. I remember a discussion in June this year, where somebody had the same requirement like you. Please have a look there: here