Here you can find the source of storeWindowBounds(java.awt.Window window, java.util.prefs.Preferences prefs)
static public void storeWindowBounds(java.awt.Window window, java.util.prefs.Preferences prefs)
//package com.java2s; // This copy of Ice is licensed to you under the terms described in the import java.awt.Rectangle; public class Main { static public void storeWindowBounds(java.awt.Window window, java.util.prefs.Preferences prefs) { if (window instanceof java.awt.Frame) { java.awt.Frame frame = (java.awt.Frame) window; boolean maximized = frame.getExtendedState() == java.awt.Frame.MAXIMIZED_BOTH; prefs.putBoolean("maximized", maximized); }/*w w w. j a v a 2 s . co m*/ Rectangle rect = window.getBounds(); prefs.putInt("x", rect.x); prefs.putInt("y", rect.y); prefs.putInt("width", rect.width); prefs.putInt("height", rect.height); } }