A JDialog configured with HIDE_ON_CLOSE becomes invisible after closing it. But it is still visible in the peek preview of the Windows taskbar. The preview is corrected only after the main window is minimized and maximized again. Of course one could dispose the dialog instead of hiding it, but that's not what I am aiming for.
- Is this a Java Swing bug?
- Is it possible to force a refresh of the taskbar preview?
- Any other workaround?
Code sample:
public static void main( String[] args ) throws Exception {
JFrame frame = new JFrame();
frame.setTitle( "frame" );
frame.setSize( 700, 700 );
frame.setVisible( true );
frame.setDefaultCloseOperation( JDialog.EXIT_ON_CLOSE );
JDialog d = new JDialog( frame ); // modeless dialog
d.setTitle( "dialog" );
d.setSize( 300, 300 );
d.setDefaultCloseOperation( JDialog.HIDE_ON_CLOSE );
d.setVisible( true );
}
