Guillaume F.
Guillaume F.

Reputation: 1130

Jide DockableFrame: how do use WindowListener for my docking frame?

I'm using the DockableFrame class (extends JComponent) from the Jide docking framework.

I want to add a listener to run some code when the docking frame is closed.

I tried to find information but every source I read tell me to use addWindowListener(), which I can't do because DockableFrame is not a JFrame and doesn't have the addWindowListener() method.

How can I add a listener that fires when the docking frame is closed?

Upvotes: 0

Views: 145

Answers (1)

Guillaume F.
Guillaume F.

Reputation: 1130

Use addDockableFrameListener() with dockableFrameHidden() instead of addWindowListener():

addDockableFrameListener(
    new DockableFrameAdapter() {
      @Override
      public void dockableFrameHidden(DockableFrameEvent dockableFrameEvent) {
        ...
      }
    });

Upvotes: 0

Related Questions