I have an applet which has been set to Card layout. I have added 3 panel with control in it. How can i know, that a panel has come to the top and is visible to the user. Which listener should be used?
I haven't found any listener appropriate for do that, but I think this can work:
As the card layout flips the panel when the user clicks the tab, you can add a MouseListener and in the onclick method you can compare the prevois selected panel with the actual panel (having the previous one in a variable) so if they are different, a new panel has come to the top. You can know that a panel is visible asking the content directly if isVisible()...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.