开发者

MDI application with window management

开发者 https://www.devze.com 2023-03-29 03:12 出处:网络
How can I develop MDI application with window management option where one child from only open one time, if user again click on to open the same child form application should display the instance of s

How can I develop MDI application with window management option where one child from only open one time, if user again click on to open the same child form application should display the instance of same child form.

I am using JFrame a开发者_StackOverflow中文版nd JInternalFrame.

How can I check that the instance of my child form is already created and opened.


you can set the status of the window in the boolean object. Like when you open the window at that time set the value of boolean object to true and when it close set to false this boolean object you can set in specific class or to set in one general class where you can maintain the all the class status in one class

you need to override this method in your class for JInternalFrame in each window you open it

yourinternalframe.addInternalFrameListener(new javax.swing.event.InternalFrameAdapter() {
    public void internalFrameClosing(InternalFrameEvent e) {
       ///// here you can change the status of boolean object set to false so when again it will open it
    }
});
0

精彩评论

暂无评论...
验证码 换一张
取 消