File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes JInternal Frame Border Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JInternal Frame Border" Watch "JInternal Frame Border" New topic
Author

JInternal Frame Border

Derek Boring
Ranch Hand

Joined: Aug 15, 2006
Posts: 63
Hi y'all!

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.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10360
    
    8

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.


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4542
    
    5

Originally posted by Maneesh Godbole:

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.


luck, db
There are no new questions, but there may be new answers.
Derek Boring
Ranch Hand

Joined: Aug 15, 2006
Posts: 63
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.

Thanks for your help guys.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JInternal Frame Border