Java Window putWindowNormalBounds(Window window, Rectangle bounds)

Here you can find the source of putWindowNormalBounds(Window window, Rectangle bounds)

Description

Puts Window bounds to client property.

License

Open Source License

Parameter

Parameter Description
window the target Window
bounds bounds

Declaration

public static void putWindowNormalBounds(Window window, Rectangle bounds) 

Method Source Code

//package com.java2s;
/*/*w ww  .ja  va2  s  . co m*/
 * Copyright (C) 2009 Illya Yalovyy
 * Use is subject to license terms.
 */

import java.awt.Rectangle;
import java.awt.Window;
import javax.swing.JFrame;

public class Main {
    private static final String WINDOW_STATE_NORMAL_BOUNDS = "WindowState.normalBounds";

    /**
     * Puts {@code Window} bounds to client property.
     * @param window the target {@code Window}
     * @param bounds bounds
     */
    public static void putWindowNormalBounds(Window window, Rectangle bounds) {
        if (window instanceof JFrame) {
            ((JFrame) window).getRootPane().putClientProperty(WINDOW_STATE_NORMAL_BOUNDS, bounds);
        }
    }
}

Related

  1. hideWaitPane(Window win, Timer timer)
  2. installPrefsHandler(final Preferences prefs, final String name, Window window)
  3. isResizable(Window window)
  4. modifyDimensions(Window window)
  5. openWindow(final JPanel panel)
  6. removeWindow(Window w)
  7. repaintMnemonicsInWindow(Window w)
  8. setWindowAlpha(Window w, int value)
  9. setWindowOpacity(Window window, float opacity)