Here you can find the source of setDirty(JFrame frame, boolean isDirty)
public static void setDirty(JFrame frame, boolean isDirty)
//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)); } }