Java JFrame setPersistentExtendedStateMask(JFrame frame, int persistentExtendedStateMask)

Here you can find the source of setPersistentExtendedStateMask(JFrame frame, int persistentExtendedStateMask)

Description

Sets JFrame extended state mask on this frame.

License

Open Source License

Parameter

Parameter Description
frame the frame, JFrame , who extended state mask is being set.
persistentExtendedStateMask mask which will be bitwise and'ed to this frame's extended state immediately before persisting it.

Declaration

public static void setPersistentExtendedStateMask(JFrame frame, int persistentExtendedStateMask) 

Method Source Code

//package com.java2s;
/*//  w w  w .jav a2 s .  c  o  m
 * Copyright (C) 2009 Illya Yalovyy
 * Use is subject to license terms.
 */

import javax.swing.JFrame;

public class Main {
    private static final String FRAME_PERSISTENT_EXTENDED_STATE_MASK = "FrameState.persistentExtendedStateMask";

    /**
     * Sets {@code JFrame} extended state mask on this frame. Used to block
     * certain extended state flags from being persisted. See {@code Frame} for
     * known extended state constants. <p>For example, if you want to close an
     * iconified application and have it open in the normal state, call
     * <code>setPersistentExtendedStateMask(frame, ~Frame.ICONIFIED)</code>
     * while initializing the application's frames.
     *
     * @param frame the frame, {@code JFrame}, who extended state mask is being
     * set.
     * @param persistentExtendedStateMask mask which will be bitwise and'ed to
     * this frame's extended state immediately before persisting it.
     */
    public static void setPersistentExtendedStateMask(JFrame frame, int persistentExtendedStateMask) {
        frame.getRootPane().putClientProperty(FRAME_PERSISTENT_EXTENDED_STATE_MASK, persistentExtendedStateMask);
    }
}

Related

  1. setGeneralParameters(final JFrame window)
  2. setInfo(String info, JFrame root)
  3. setJFrameAlwaysOnTop(JFrame frame, boolean newValue)
  4. setMainWindowLocation(JFrame jfrm, String strPropertiesFilePath, String strPropertiesFileName)
  5. setPanel(JPanel parent, JPanel child, JFrame f)
  6. setWindowListenerDispose(JFrame frame)
  7. setWindowRightSide(final JFrame frame)
  8. setWinVisible(final JFrame win, final boolean vis)
  9. smartSetBounds(JFrame frame)