Here you can find the source of getWindowNormalBounds(Window window)
Parameter | Description |
---|---|
window | the source Window |
public static Rectangle getWindowNormalBounds(Window window)
//package com.java2s; /*//w w w .j ava 2 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"; /** * Gets {@code Window} bounds from the client property * @param window the source {@code Window} * @return bounds from the client property */ public static Rectangle getWindowNormalBounds(Window window) { if (window instanceof JFrame) { Object res = ((JFrame) window).getRootPane().getClientProperty(WINDOW_STATE_NORMAL_BOUNDS); if (res instanceof Rectangle) { return (Rectangle) res; } } return null; } }