Title/Icon bar thickness on Frame
Posted on 2004-03-31
I have an app that positions a component (JButton say) and draws a Rectangle2D around it.
This using Swing and Java2D with absolute positioning:
rect = new Rectangle2D.Double(75,75,60,45);
Okay, works fine until I run the app on my laptop and the button and rectangle don't line up.
It seems that I use Large Fonts for my Win98se under Properties/Settings and Small Fonts for my laptop. Yes, has the same (not wanted) result if I change the settings to Small.
I believe that Swing positions 0,0 from the working area of the frame (for me a gray color) and Java2D starts at the top corner of the frame (above the blue icon/title bar). For Large Fonts that bar is thicker and so the button moves down.
What I need is a Swing version like JRectangle ( and JLine for that matter).
Anything like this exist or is there another fix?
Thank you, Squeeto