painting objects on a frame

Hello!

I wrote a desktop application in Java. When I run the app sometimes happens that all the objects aren't shown on the frame. If I move with the mose over positions where the not showing objects must be located they suddenly appear. How can I fix this problem?

I have jre 1.6 installed and all availible updates.

Thanks!

[351 byte] By [Funky_1321a] at [2007-11-27 7:02:33]
# 1
repaint() or update() after drawing?
suparenoa at 2007-7-12 18:53:36 > top of Java-index,Desktop,Core GUI APIs...
# 2

Its probably because you add components to the frame AFTER the frame is visible. So add all your components to the content pane first before making the frame visible.

If during normal program execution you dynamically add components to a visible panel then you would use, panel.revalidate().

> repaint() or update() after drawing?

Do not use update(), that is for a LAF change.

camickra at 2007-7-12 18:53:36 > top of Java-index,Desktop,Core GUI APIs...
# 3
> > repaint() or update() after drawing? > > Do not use update(), that is for a LAF change.thanks for the correction
suparenoa at 2007-7-12 18:53:36 > top of Java-index,Desktop,Core GUI APIs...
# 4
I get it. Thanks :) !
Funky_1321a at 2007-7-12 18:53:36 > top of Java-index,Desktop,Core GUI APIs...