Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Center vertical text on a clabel
Center vertical text on a clabel [message #479893] Wed, 12 August 2009 22:44 Go to next message
Eclipse UserFriend
Originally posted by:

Can anybody tell me how can i center vertical text on a CLabel?
I mean: i have a clabel using formdata/formlayout. Normally the text
centers well, but now, the clabel y a bit higher than usually and the
text lays on the upper side of a clabel.
As my english isn't very good, i ask graphically:


----------- --------------- -------------
Text------- Text----------- -------------
----------- --------------- Text---------
--------------- -------------
--------------- -------------

Re: Center vertical text on a clabel [message #481905 is a reply to message #479893] Mon, 24 August 2009 16:55 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
Hi, sorry for the late reply,

To clarify, you are saying that when a CLabel is very tall that its text
does not show vertically-centered, right? I tried this with the snippet
below and it seems well-centered for me (I tried on win2000). How does the
snippet work for you? And if its text is centered, are you able to change
the snippet to show the bad behaviour that you are seeing?

public static void main (String [] args) {
final Display display = new Display ();
final Shell shell = new Shell (display);
CLabel label = new CLabel(shell, SWT.BORDER);
while (!shell.isDisposed ()) {
if (!display.readAndDispatch ()) display.sleep ();
display.dispose ();


"Vicente Rico Guill
Previous Topic:Difficulties scrolling a ListViewer
Next Topic:Table header menu snippet
Goto Forum:

Current Time: Mon Jan 27 02:14:15 GMT 2020

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

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

Back to the top