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 JInternal frame little (or not) problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JInternal frame little (or not) problem" Watch "JInternal frame little (or not) problem" New topic

JInternal frame little (or not) problem

Vinicius Souza
Ranch Hand

Joined: May 18, 2011
Posts: 70

Im creating a simple application where when I cklick on a button its load a JInternalFrame and show it up on the CENTER of my getContentPane() using BorderLayout. But the problem is that its only appear when I resize the main form.... Im using setVisible(true) on the constructor but its not working. See:

What's wrong ?
Thanks in advance!

Java is the best (I love C too) heehhh
Darryl Burke

Joined: May 03, 2008
Posts: 5115

1. A JInternalFrame is designed to be contained in a JDesktopPane.
2. Whenever adding/removing components to/from an already realized container, it is always necessary to revalidate() the container, and usually also to repaint() it.

That revalidation and repainting is triggered when you resize the window.

luck, db
There are no new questions, but there may be new answers.
Vinicius Souza
Ranch Hand

Joined: May 18, 2011
Posts: 70

Thank you a lot! Worked like a charm I will read more about this issue.
I agree. Here's the link:
subject: JInternal frame little (or not) problem
It's not a secret anymore!