08-30-2008, 08:25 AM
|
#2 (permalink)
|
| Thumbs Must Hurt
Join Date: Apr 2008 Model: 8130 PIN: N/A Carrier: US Cellular
Posts: 82
Post Thanks: 0 Thanked 0 Times in 0 Posts
| To answer my own question, it appears the API docs are flat-out wrong. It states that HCENTER centers text about the anchor point. Instead you have to specify the anchor as the left-most value of the box you want the text centered in, and provide the width of the drawing area:
g.drawText("Test", 0, getHeight()/2, DrawStyle.HCENTER, getWidth()); |
| Offline
| |