File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes How do I force a container to repaint? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "How do I force a container to repaint?" Watch "How do I force a container to repaint?" New topic
Author

How do I force a container to repaint?

Tom Niesytto
Greenhorn

Joined: Mar 02, 2000
Posts: 2
Howdy (no I am not from TX),
let's assume I have a JFrame with FlowLayout.
I add some components to it and do setVisible().
Later I decide to change some layout parameter
eg. do setHgap() on the FlowLayout object.
Now - how do I force JFrame to repaint?
Thanks,
Tom
Tom Niesytto
Greenhorn

Joined: Mar 02, 2000
Posts: 2
Just to enhance the question...
I tried to use update(Graphics) (after resetting hgap)
and adding my own paint(Graphics) method but then
the effect of changing hgap is visible only after
window is resized (and after going out of focus and back
to clear clutter).
Sorry for trivial question but I cannot seem to find the
answer in books that I have.
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18670
Try calling validate() (from Component) on the container.


"I'm not back." - Bill Harding, Twister
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: How do I force a container to repaint?
 
Similar Threads
repaint problem in JPanel
JFrame
Displaying an image in a subpanel
My panel object won't repaint(). Please help.
How to update a JFrame?