Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Feb 2010
    Posts
    95
    Thanks
    14
    Thanked 0 Times in 0 Posts

    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?

  • #2
    New Coder
    Join Date
    Feb 2010
    Posts
    95
    Thanks
    14
    Thanked 0 Times in 0 Posts
    solved it with the following x-value: dimension.getWidth() / 2 - font.stringWidth(text)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •