File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes JInternalFrame woes  Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JInternalFrame woes  " Watch "JInternalFrame woes  " New topic

JInternalFrame woes

xiss burg

Joined: Mar 04, 2009
Posts: 3
the question is how to correctly add a JInternalFrame to a JFrame(already with lots of other components in it(JPanels, JTables, JButtons, etc) and make it appear over everything. If I add it to the contentPane it appears behind everything and lots of strange things start to happen =|. If I add to the layeredPane nothing happens...

Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

First, the use case is not what a JInternalFrame is used for. Secondly, looks like you've been getting some help on the Sun forums but are unwilling to help by providing some code. I don't suspect you'll get much more help here for the same reasons if you continue down that path. We can't magically look into your computer and tell you why your code doesn't work.

But I guess my first question is back to my first statement. I'm with everyone else in saying that a JDialog is the preferred solution. You asked why JInternalFrame is being discouraged. It isn't being discouraged because it it buggy, but rather because of misuse. To get what you are after you are going to have to look into layered panes and/or the Glass Pane to achieve what you want.

GenRocket - Experts at Building Test Data
xiss burg

Joined: Mar 04, 2009
Posts: 3
I agree. Here's the link:
subject: JInternalFrame woes
jQuery in Action, 3rd edition