File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes A TOUGH question on JInternal Frame Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "A TOUGH question on JInternal Frame" Watch "A TOUGH question on JInternal Frame" New topic
Author

A TOUGH question on JInternal Frame

Richard Teston
Ranch Hand

Joined: Feb 12, 2002
Posts: 89
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.


The Code is the Programmer
Rene Liebmann
Ranch Hand

Joined: May 02, 2002
Posts: 196
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

Rene
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15286
    
    6

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.


GenRocket - A Test Data Generation Platform
Richard Teston
Ranch Hand

Joined: Feb 12, 2002
Posts: 89
Oh yeah! forgot to mention that both the main-screen and the sub-screen are JInternalFrame, sorry Gregg.
Richard Teston
Ranch Hand

Joined: Feb 12, 2002
Posts: 89
I tried to set to visible the glasspane of the main-screen (w/c is a JInternalFrame) but i can still click on its components. Any other way?
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15286
    
    6

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.
Rene Liebmann
Ranch Hand

Joined: May 02, 2002
Posts: 196
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: A TOUGH question on JInternal Frame
 
Similar Threads
JFrame window not refreshing while record added
splash screen
Disabling modaled JInternalFrame
JavaScript Menu, Submenu and Framesets
JDialog &Modal.