Java Utililty Methods Window Size

List of utility methods to do Window Size

Description

The list of methods to do Window Size are organized into topic(s).

Method

RectanglegetRectangle(Window win)
Get a Rectangle object representing the given window's position and magnitude in space.
return new Rectangle(win.getY(), win.getX(), win.getWidth(), win.getHeight());
RectanglegetRectangle(Window win)
Get a Rectangle object representing the given window's position and magnitude in space.
Rectangle Rectangle = new Rectangle(win.getY(), win.getX(), win.getWidth(), win.getHeight());
return Rectangle;
voidsetWidthPercentageOfScreen(Window window, int widthPercentage)
set Width Percentage Of Screen
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
int width = (screenSize.width * widthPercentage) / 100;
int height = window.getHeight();
window.setSize(width, height);
center(window);