Search code examples
javaswingjinternalframe

How can handle JInternalFrame Close opeartion from JDesktopPane?


I have one JFrame(HMSDoctor) and in that i am calling one JInternalFrame(CurrentOPD) by using JDesktopPane.

//opening JInternalFrame(CurrentOPD) by using JDesktopPane in JFrame(HMSDoctor).

       JDesktopPane jdp=new JDesktopPane();
   jdp.add(new CurrentOPD);

//Above code display proper JInternalFrame.

When i close that JInternalFrame at that time i want to execute one other JInternalFrame(Follow) in JFrame(HMSDoctor).

How can i do like that?


Solution

  • Yes, First you have to addInternalFramaeListener in main frame and when your JInternalFrame(CurrentOPD) closed at that time you can call JInternalFrame(Follow)