List of utility methods to do Rectangle Bounds
void | setBounds(java.awt.Rectangle hole, int xA, int yA, int xB, int yB) set Bounds hole.x = Math.min(xA, xB); hole.y = Math.min(yA, yB); hole.width = Math.abs(xB - xA); hole.height = Math.abs(yB - yA); |
void | storeWindowBounds(java.awt.Window window, java.util.prefs.Preferences prefs) store Window Bounds 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); Rectangle rect = window.getBounds(); prefs.putInt("x", rect.x); prefs.putInt("y", rect.y); ... |