• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Question about JInternalFrame

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, guys!
I'm working on a little project and I having some difficulties using JInternalFrame
Let me explain what's going on:

I have a JDesktopPane and I am adding a JInternalFrame (A) to it.
Inside (A) I have a JButton that make an instance of another JInternalFrame (B) and add it to the JDesktopPane as well.

The questions are:

1) How can I make (A) accessible only when (B) is closed???

2) Why (B).setSelected(true) and (B).moveToFront() doesn't work in this case?? (B) always appears behind (A)...

Thank's!!!

Baldo.
 
Alexandre Baldo
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

2) Why (B).setSelected(true) and (B).moveToFront() doesn't work in this case?? (B) always appears behind (A)...



Sorry guys! I just figured out what's going on with question #2!
I was doing this:


BUT...... I was suposed to do desktop.add(frame); FIRST!

Now just left #1!

Thank's!

Baldo.
 
Sheriff
Posts: 22781
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When the button is clicked, besides showing B you should call "setVisible(false)" on A. That will hide it.

Add an InternalFrameListener to B; extend InternalFrameAdapter for ease. Override "internalFrameClosed", and in it call "setVisible(true)" on A. That will show it again.
 
Alexandre Baldo
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank's Rod!!

But I dont't want to make (A) invisible. I want (B) to be modal...
I'll try to instance (B) as a JDialog.
I was reading the API and I think it could work...

Thanks again!

Baldo.
 
Rob Spoor
Sheriff
Posts: 22781
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It should work, but it will be modal for the entire application, not just A.
 
reply
    Bookmark Topic Watch Topic
  • New Topic