Go Back   CodingForums.com > :: Server side development > Java and JSP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-15-2010, 11:43 AM   PM User | #1
earni23
New Coder

 
Join Date: Feb 2010
Posts: 95
Thanks: 14
Thanked 0 Times in 0 Posts
earni23 has a little shameless behaviour in the past
How to center text in lwuit-graphics with drawString

Hi
How do you center text in lwuit-graphics with drawString(...) ? In "javax.microedition.lcdui.Graphics" you use Graphics.HCENTER, but how do you this in lwuit.graphics?
earni23 is offline   Reply With Quote
Old 11-16-2010, 01:03 PM   PM User | #2
earni23
New Coder

 
Join Date: Feb 2010
Posts: 95
Thanks: 14
Thanked 0 Times in 0 Posts
earni23 has a little shameless behaviour in the past
solved it with the following x-value: dimension.getWidth() / 2 - font.stringWidth(text)
earni23 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:17 PM.


Advertisement
Log in to turn off these ads.