You can try to get the maximum "overall" window size. Since your application is maximized, it should give the same result:
GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment(); Dimension screenDimension = env.getMaximumWindowBounds().getSize();
Do not forget that your window also has the so-called inserts:
Insets insets = frame.getInsets(); final int left = insets.left; final int right = insets.right; final int top = insets.top; final int bottom = insets.bottom; final int width = screenDimension.width - left - right; final int height = screenDimension.height - top - bottom;
source share