This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of Testing JavaScript Applications and have Lucas da Costa on-line!
See this thread for details.
Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

A TOUGH question on JInternal Frame

 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Richard Teston
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh yeah! forgot to mention that both the main-screen and the sub-screen are JInternalFrame, sorry Gregg.
 
Richard Teston
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
If I had asked people what they wanted, they would have said faster horses - Ford. Tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic