I have a JInternalFrame inwhich I have overwritten the paint method. However, I have found that (0,0) is on top of the "title bar" for the JInternal frame. I know I could just play with numbers until I find the right vertical offset, but I want to do it the professional way. I already figured out how to get the width of the border, but now my question is:
How do I find out the height of the title bar?
Life is 10% what happens and 90% how you react to it.
Attitude is everything.
Originally posted by Derek Boring: I know I could just play with numbers until I find the right vertical offset, but I want to do it the professional way.
Professional way: 1) Run a loop so that you dont have to do it manually. 2) Find the screen co-ordinates of the content pane and compare them with the co-ordinates of the frame. 3) Try 22. If it doesnt work try 27. Still doesnt work, refer 1 and 2 above.
2) Find the screen co-ordinates of the content pane and compare them with the co-ordinates of the frame.
Just thinking... if that gives the corect result, the difference of getHeight() should also do it.
There are no new questions, but there may be new answers.
Joined: Aug 15, 2006
That makes perfect sense. But I'm still curious, I know that the title bar for a JInternalFrame isn't an official OS title bar, but since it's drawn by Java, wouldn't it make sense that the UI manager or some other module would know the dimensions of it?
I'll use your suggestion for now, but this makes me wonder how the JInternalFrame knows where to position the content pane vertically.