monitoring visibility on screen of component

Hey all,

I have a component that is part of a complex component hierarchy, and I would like to know when it becomes visible and invisible, but not in the sense of the isVisible() function -- I want to know when it is actually visible or invisible. I tried adding a component listener, but that doesn't really solve the problem unless I add component listeners to the entire component hierarchy, which seems like it could result in some memory leaks unless I know when to remove the listeners. Plus it just feels like there's a better solution than recursively adding listeners and calling isVisible() recursively up the tree every time an event fires. I must be missing something obvious.

Any help appreciated.Tthanks,

bjorn

[751 byte] By [bjornbjorna] at [2007-11-27 10:50:52]
# 1

For a visibilty check

component.isShowing()

ICE

icewalker2ga at 2007-7-29 11:27:52 > top of Java-index,Desktop,Core GUI APIs...
# 2

Great, thanks! Now I just need a way to monitor for changes to isShowing().

bjorn

bjornbjorna at 2007-7-29 11:27:52 > top of Java-index,Desktop,Core GUI APIs...
# 3

I'm not sure, but a ComponentListener might do the trick!

-Puce

Pucea at 2007-7-29 11:27:52 > top of Java-index,Desktop,Core GUI APIs...
# 4

Since there aint any code to actually know what you are doing, I can only suggest.

Try several of the other listeners such ContainerListener, one might be able to give you what you want. ContainerListener listens for add( ) and remove( ) method events, which might be what you are looking for

ICE

icewalker2ga at 2007-7-29 11:27:52 > top of Java-index,Desktop,Core GUI APIs...