LazySloth13
LazySloth13

Reputation: 2487

Padding on JFrame in Windows 7

I noticed that on a JFrame, there is always padding for the blue borders in Windows 7 (they're something like 30 horizontally and 10 vertically). What are the exact values of these paddings and do they change between different versions of Windows?

Upvotes: 3

Views: 293

Answers (1)

FThompson
FThompson

Reputation: 28707

As @MadProgrammer mentioned in a comment, the values differ between different looks and feels. However, you can easily acquire the exact values at runtime using Container#getInsets().

JFrame frame = new JFrame("title");
frame.setVisible(true);
System.out.println(frame.getInsets());

It's worth mentioning that the insets will all be 0 until the frame has been made visible.

Upvotes: 3

Related Questions