| View previous topic :: View next topic |
| Author |
Message |
Connell Gauld Guest
|
Posted: Sat Nov 22, 2003 5:56 pm Post subject: Titlebars of Frames |
|
|
Hi,
I'm writing some software in Java which requires a complicated gui. As a
result I have to use exact positioning rather than a Layout manager. I am
using the standard java.awt.* (ie not JFrame just Frame) and the latest
version of the Sun J2SDK. My problem is that when I create a Frame and add
components, all co-ordinates are relative to the very top left of the
window (including the titlebar). As a result the tops of some of my
components are hidden under the titlebar. Is there any way I can find the
height of the titlebar so that I can compensate for this.
Any help would be much appreciated.
Thanks
Connell
|
|
| Back to top |
|
 |
David Postill Guest
|
Posted: Sat Nov 22, 2003 6:58 pm Post subject: Re: Titlebars of Frames |
|
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
In article <bpo7tt$6ug$1 (AT) news6 (DOT) svr.pol.co.uk>, on Sat, 22 Nov 2003 17:56:59 +0000, Connell Gauld
<me (AT) DINNAYSPAM (DOT) com>
wrote:
| Quote: | Hi,
I'm writing some software in Java which requires a complicated gui. As a
result I have to use exact positioning rather than a Layout manager. I am
using the standard java.awt.* (ie not JFrame just Frame) and the latest
version of the Sun J2SDK. My problem is that when I create a Frame and add
components, all co-ordinates are relative to the very top left of the
window (including the titlebar). As a result the tops of some of my
components are hidden under the titlebar. Is there any way I can find the
height of the titlebar so that I can compensate for this.
Any help would be much appreciated.
|
RTFM: <http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Frame.html>
Your question is answered in the description of class Frame.
<davidp />
- --
David Postill
-----BEGIN PGP SIGNATURE-----
Version: PGP 8.0.3 - not licensed for commercial use: www.pgp.com
Comment: Get key from pgpkeys.mit.edu:11370
iQA/AwUBP7+rP3xp7q1nhFwUEQI+8wCg1D0QOFgZ6JKu+Pdpk888a/vigZgAoKsj
pJnK6YTYyKz7Y+Doz/gn4dQL
=q2X3
-----END PGP SIGNATURE-----
|
|
| Back to top |
|
 |
Harald Hein Guest
|
Posted: Sat Nov 22, 2003 9:57 pm Post subject: Re: Titlebars of Frames |
|
|
"Connell Gauld" wrote:
| Quote: | I'm writing some software in Java which requires a complicated
gui. As a result I have to use exact positioning rather than a
Layout manager.
|
You are lying to yourself.
|
|
| Back to top |
|
 |
Jim Pete Guest
|
Posted: Sun Nov 23, 2003 7:50 pm Post subject: Re: Titlebars of Frames |
|
|
Use GridBagLayout... it'll save you a ton of time... TRUST ME!
"Connell Gauld" <me (AT) DINNAYSPAM (DOT) com> wrote
| Quote: | Hi,
I'm writing some software in Java which requires a complicated gui. As a
result I have to use exact positioning rather than a Layout manager. I am
using the standard java.awt.* (ie not JFrame just Frame) and the latest
version of the Sun J2SDK. My problem is that when I create a Frame and add
components, all co-ordinates are relative to the very top left of the
window (including the titlebar). As a result the tops of some of my
components are hidden under the titlebar. Is there any way I can find the
height of the titlebar so that I can compensate for this.
Any help would be much appreciated.
Thanks
Connell
|
|
|
| Back to top |
|
 |
Florian 'Irian' Schaetz Guest
|
Posted: Mon Nov 24, 2003 10:40 am Post subject: Re: Titlebars of Frames |
|
|
"Jim Pete" <jimmypete2k3 (AT) hotmail (DOT) com> wrote
| Quote: | Use GridBagLayout... it'll save you a ton of time... TRUST ME!
|
Would suggest using TableLayout instead.
Flo
|
|
| Back to top |
|
 |
Rene Ruppert Guest
|
Posted: Mon Nov 24, 2003 10:43 am Post subject: Re: Titlebars of Frames |
|
|
Hi,
| Quote: | components are hidden under the titlebar. Is there any way I can find the
height of the titlebar so that I can compensate for this.
|
Try "getInsets()".
cu
Rene
|
|
| Back to top |
|
 |
|