Birkemose said:
I was trying to adjust the position of a pop-up menu.
The idea is the pop-up should be used for all overlaying componenets (
drawing areas ), ie I pop up relatively to the basic JFrame.
I can adjust the pop-up position for whetever component I like, but I was
missing the menu and borders of the JFrame.
Why would getInsest not work on other platforms ?
It doesn't have any consistent meaning. If you do
JFrame.setDefaultLookAndFeelDecorated(true), for
Look & Feels and systems that support it, the frame
insets will be (0, 0, 0, 0) even though there is a border
and title bar. DefaultLookAndFeelDecorated is just a
hint, so any particular Look & Feel might choose to
provide its own title bar and borders despite the
setting, with the same result.
I'm not sure exactly what you're after though.
If you want the area not including the title bar, menus,
and borders, then use the bounds of the content pane.
If you want the area of the JFrame excluding the title
bar and borders but including the menu, I'm not sure
there is any guaranteed way to get that. Using the root
pane bounds and insets will get you closer, but still
includes the title bar if it is provided by the Look &
Feel. I suppose you could use the union of the bounds
of the menu bar and content pane, though I'm not
sure offhand what would happen on Mac Look & Feel
with the menu at the top of the screen.