Java JFrame setDirty(JFrame frame, boolean isDirty)

Here you can find the source of setDirty(JFrame frame, boolean isDirty)

Description

set Dirty

License

Open Source License

Declaration

public static void setDirty(JFrame frame, boolean isDirty) 

Method Source Code

//package com.java2s;
// modify it under the terms of the GNU Lesser General Public License

import javax.swing.JComponent;
import javax.swing.JDialog;
import javax.swing.JFrame;

public class Main {
    public static void setDirty(JFrame frame, boolean isDirty) {
        setDirty(frame.getRootPane(), isDirty);
    }/*from w ww .j  a  v a 2s  .c  o m*/

    public static void setDirty(JDialog dialog, boolean isDirty) {
        setDirty(dialog.getRootPane(), isDirty);
    }

    private static void setDirty(JComponent comp, boolean isDirty) {
        if (comp != null)
            comp.putClientProperty("windowModified", Boolean.valueOf(isDirty));
    }
}

Related

  1. saveFrame(Class pClass, JFrame pFrame, String pFrameId)
  2. saveMainWindowLocation(JFrame jfrm, String strPropertiesFilePath, String strPropertiesFileName)
  3. setBlockAllUserInput(final JFrame frame, final boolean yesNo)
  4. setCursorFree(JFrame frame)
  5. setDialogLocation(JFrame frame, JFrame parentFrame)
  6. setEscapeAction(JFrame frame, Action action)
  7. setEscapeClosable(JFrame frame)
  8. setESCCloseable(final JFrame aFrame)
  9. setFrameBottomRight(final JFrame frame)