Here you can find the source of putWindowNormalBounds(Window window, Rectangle bounds)
Parameter | Description |
---|---|
window | the target Window |
bounds | bounds |
public static void putWindowNormalBounds(Window window, Rectangle bounds)
//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); } } }