Saturday, 31 August 2013

How to check JDialog state

How to check JDialog state

I have a JDialog and I'd like to check whether its state is maximized,
minimized or normal. How can I do that?
I have tried:
private JDialog dialog = new JDialog();
dialog.addWindowStateListener(new WindowStateListener() {
@Override
public void windowStateChanged(WindowEvent e) {
if(e.getNewState()==JFrame.MAXIMIZED_BOTH){
System.out.println(" state MAXIMIZED_BOTH");
dialog.repaint();
}
}
});
but it doesn't work of course.
Thanks

No comments:

Post a Comment