Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » vertically center text in label
vertically center text in label [message #438116] Wed, 16 June 2004 15:11 Go to next message
Heitzso is currently offline HeitzsoFriend
Messages: 20
Registered: July 2009
Junior Member
I need to vertically align text CENTER
within labels. However, am not seeing
a way to do that. What happens, instead,
is the text is biased upwards within the
label area. This bias appears to be
excessive, even when the possibility of
descenders is taken into account.

Suggestions would be greatly appreciated.

(note my label background is high contrast
diff from app background, hence the obviousness
of the problem which probably isn't often
seen because the norm would be no border
and label background == app background)
Re: vertically center text in label [message #438215 is a reply to message #438116] Thu, 17 June 2004 15:40 Go to previous messageGo to next message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
SWT.CENTER aligns horizontally. To align vertically, you need to use a
layout or center it yourself using setLocation().

"Heitzso" <heitzso@growthmodels.com> wrote in message
news:capnul$ir3$1@eclipse.org...
> I need to vertically align text CENTER
> within labels. However, am not seeing
> a way to do that. What happens, instead,
> is the text is biased upwards within the
> label area. This bias appears to be
> excessive, even when the possibility of
> descenders is taken into account.
>
> Suggestions would be greatly appreciated.
>
> (note my label background is high contrast
> diff from app background, hence the obviousness
> of the problem which probably isn't often
> seen because the norm would be no border
> and label background == app background)
>
>
Re: vertically center text in label [message #438287 is a reply to message #438215] Sat, 19 June 2004 15:00 Go to previous messageGo to next message
Heitzso is currently offline HeitzsoFriend
Messages: 20
Registered: July 2009
Junior Member
setLocation() positions the widget within the shell or composite area.

What I need to do is position the text better vertically within the Label,
not the Label within the shell or composite.


> SWT.CENTER aligns horizontally. To align vertically, you need to use a
> layout or center it yourself using setLocation().

> "Heitzso" <heitzso@growthmodels.com> wrote in message
> news:capnul$ir3$1@eclipse.org...
> > I need to vertically align text CENTER
> > within labels.
Re: vertically center text in label [message #438301 is a reply to message #438287] Mon, 21 June 2004 13:04 Go to previous message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
Center the label within the composite to get the same effect.

"Heitzso" <heitzso@growthmodels.com> wrote in message
news:cb1keh$sgu$1@eclipse.org...
> setLocation() positions the widget within the shell or composite area.
>
> What I need to do is position the text better vertically within the Label,
> not the Label within the shell or composite.
>
>
> > SWT.CENTER aligns horizontally. To align vertically, you need to use a
> > layout or center it yourself using setLocation().
>
> > "Heitzso" <heitzso@growthmodels.com> wrote in message
> > news:capnul$ir3$1@eclipse.org...
> > > I need to vertically align text CENTER
> > > within labels.
>
Previous Topic:classpath
Next Topic:Toolbar Buttons and MouseMoveListening
Goto Forum:
  


Current Time: Sat Apr 27 00:25:38 GMT 2024

Powered by FUDForum. Page generated in 1.75409 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top