JFrame: get size without borders?

Tom picture Tom · Feb 23, 2011 · Viewed 43.5k times · Source

In Java, is it possible to get the Width and Height of the JFrame without the title and other borders?

frame.getWidth() and frame.getHeight()1 seems to return the width including the border.

Thanks.

Answer

user489041 picture user489041 · Feb 23, 2011

frame.getContentPane().getSize();