Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JInternal frame little (or not) problem

 
Vinicius Souza
Ranch Hand
Posts: 70
1
Chrome Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Darryl Burke
Bartender
Posts: 5125
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Vinicius Souza
Ranch Hand
Posts: 70
1
Chrome Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you a lot! Worked like a charm I will read more about this issue.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic