0

Hi all,

I am creating one GUI application in java. I need to make menubar visible when particular panel is made invisible. Is it possible by creating an event which will be triggered when panel is made invisible? Can anybody help me?

Thanks in advance!!!

2
Contributors
3
Replies
5
Views
4 Years
Discussion Span
Last Post by JamesCherrill
Featured Replies
  • You can use a ComponentListener, something like: myThing.addComponentListener(new ComponentListener() { @Override public void componentShown(ComponentEvent arg0) { System.out.println(arg0); } @Override public void componentHidden(ComponentEvent arg0) { System.out.println(arg0); } @Override public void componentMoved(ComponentEvent arg0) { // not interested } @Override public void componentResized(ComponentEvent arg0) { // not interested } }); Read More

2

You can use a ComponentListener, something like:

    myThing.addComponentListener(new ComponentListener() {

         @Override
         public void componentShown(ComponentEvent arg0) {
            System.out.println(arg0);
         }

         @Override
         public void componentHidden(ComponentEvent arg0) {
            System.out.println(arg0);          
         }

         @Override
         public void componentMoved(ComponentEvent arg0) {
            // not interested
         }

         @Override
         public void componentResized(ComponentEvent arg0) {
            // not interested
         }

      });

Edited by JamesCherrill

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.