Java Utililty Methods Rectangle Bounds

List of utility methods to do Rectangle Bounds

Description

The list of methods to do Rectangle Bounds are organized into topic(s).

Method

voidsetBounds(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);
voidstoreWindowBounds(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);
...