File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java Micro Edition and the fly likes positioning the lable in palm's screen using j2me?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "positioning the lable in palm Watch "positioning the lable in palm New topic

positioning the lable in palm's screen using j2me??

eric sato
Ranch Hand

Joined: Oct 01, 2002
Posts: 37
hi all,
I'm quite new using j2me in palm. Does anyone of you has idea, how to adjust the position of the StringItem in palm screen? i'm understand that the StringItem's title will be on left justified and text will be on right, but i want it full control on it. i need to control the full screen on palm.
Thanks in advance.

If you can't change the direction the the wind, change your sail.
Matthew Phillips
Ranch Hand

Joined: Mar 09, 2001
Posts: 2676
MIDP handles the layout for all of the high level GUI components. You may be able to do something with a Canvas, but I haven't tried it.

Matthew Phillips
Pavlin Mihalev

Joined: Apr 29, 2003
Posts: 28
I am supposing that you wish to center the StringItem on the screen ? Maybe you should calculate the width of the String
Font font = Fong.getDefault(); // or your font
it str_w = font.stringWidth( yourStringItem.getLabel() ); // or getText ot both
so with this info in mind you can add additional space before and after to adjust the position. If you are dealing with a Form you can add directly the String - that gives you more freedom to operate it.
Hope this helps,

------<br />
I agree. Here's the link:
subject: positioning the lable in palm's screen using j2me??
It's not a secret anymore!