Mohamed EL Tair Mohamed EL Tair - 1 year ago 89
Java Question

java JFrame height excluding title bar?

when you specify height for JFrame the title bar consumes a part of this height, is there a method or something to know the amount of this consumed part ?

Answer Source

JFrame has a method called getInsets()

From the Javadoc:

public Insets getInsets()

Determines the insets of this container, which indicate the size of the container's border. 
A Frame object, for example, has a top inset that corresponds to the height of the frame's title bar.