Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to find JFrame border width?

843804Jan 4 2005 — edited Jan 25 2006
Hi, I need to find out the left & right border widths of a JFrame. This is easy if I have an existing object (assuming it's been painted at least once).
The border width may vary depending on the current look & feel, whether running on windows or the MAC, etc.

I want to find out this value without creating an instance of JFrame. So I thought I'd try the UIManager, and I thought I'd need something like this:
javax.swing.border.Border b = javax.swing.UIManager.getBorder("InternalFrame.border");
But of course that's for InternalFrames, not JFrames.

I can't figure this out - any ideas?
Thanks, TL

PS. Plse don't ask why I need to know this width ;-)
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 22 2006
Added on Jan 4 2005
10 comments
893 views