java swing get frame size 1

java swing get frame size

Rectangle r = frame.getBounds();
int h = (int) r.getHeight();
int w = (int) r.getWidth();

Here is what the above code is Doing:
1. We’re getting the frame’s bounds.
2. We’re getting the height and width of the frame.

Similar Posts