This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JInternal frame little (or not) problem" Watch "JInternal frame little (or not) problem" New topic
Author

JInternal frame little (or not) problem

Vinicius Souza
Ranch Hand

Joined: May 18, 2011
Posts: 45

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
Bartender

Joined: May 03, 2008
Posts: 4523
    
    5

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: 45

Thank you a lot! Worked like a charm I will read more about this issue.
 
Consider Paul's rocket mass heater.
 
subject: JInternal frame little (or not) problem
 
Similar Threads
JInternalFrame
Creating modal in JInternalFrame
Problem in adding Scroll Bar to JPanel.
Problem in JInternal Frame
Not able to minimize JInternalFrame