Java Swing Get размер рамы

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