Java JComponent Properties setDirty(JComponent comp, boolean isDirty)

Here you can find the source of setDirty(JComponent comp, boolean isDirty)

Description

set Dirty

License

Open Source License

Declaration

private static void setDirty(JComponent comp, 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 w w .ja v  a2 s .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. isVisibleOnScreen(final JComponent component)
  2. registerComponent(JComponent c)
  3. registerDataFlavors(JComponent component, DataFlavor... dataFlavors)
  4. resetDisplayComponent(JComponent mainComp, JComponent nonDispComp, JComponent newDispComp)
  5. setComponentEnabled(JComponent component, Boolean isEnabled)
  6. setGlassPane(JComponent comp, Component glass, boolean visible)
  7. setLegendVisible(JComponent chartUI, boolean visible)
  8. setLightweightDispatcher(JComponent component)
  9. showAsOnlyVisibleChild(JComponent container, Component childToBeMadeVisible)