Hi,

I have an application with one JFrame and two modeless JDialogs. When I mimimize the JFrame, the dialogs are still there, not minimized.
So i need to hide them. I can hide them with WindowDeactivated event which runs one time when the JFrame is minimized but when I want to set the dialogs visible again I cannot use WindowActivated event because it's running continuously so the dialogs and JFrame start to flicker...

I need to minimize the dialogs when the JFrame is minimized and maximize them after the JFrame is maximized or has normal state again. Please help.

Thanks

I done it! I used the status changed event of the JFrame.

private void formWindowStateChanged(java.awt.event.WindowEvent evt) {                                              
         if(this.getState()==1){//this means minimized
            minimize();
         }else if(this.getState()==0){//this means maximized/normal state
            maximize();
         }

Sorry I couldn't figure it earlier...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.