Java Swing Obtenha o tamanho da estrutura

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