Skip to main content

java.awt.Component.setVisible(false) not triggering repaint

1 reply [Last post]
Joined: 2008-07-03

We observed a test application of ours that was hiding a lightweight component, but it did not disappear. Looking at the implementation of Component.setVisible(boolean) (which just calls hide() when passed 'false'), it does not seem to generate a repaint event. I believe that this is a bug in Component. The implementation of show() correctly triggers a repaint, but hide() does not.

Anyone agree that this really is a bug?


Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2009-04-23

Component.setVisible(false) in JDK 1.4.2 does what you would expect: it triggers a repaint and hides the component. So it looks like a bug to me.