开发者

How to listen componentShown/componentHidden events better than ComponentListener?

开发者 https://www.devze.com 2023-01-06 12:53 出处:网络
I want to be informed if componentShown/componentHidden event occured. I use ComponentListener, but it doesn\'t work as good as I need. I have found this information in official Swing tutorial:

I want to be informed if componentShown/componentHidden event occured. I use ComponentListener, but it doesn't work as good as I need. I have found this information in official Swing tutorial:

开发者_开发百科

The component-hidden and component-shown events occur only as the result of calls to a Component 's setVisible method. For example, a window might be miniaturized into an icon (iconified) without a component-hidden event being fired.

So I supose I have to find another solution. So how to listen every componentShown/componentHidden event?


I don't think you will be able to do this with a single listener.

You can also use a WindowListener to listen for windowIconified.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号