• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

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

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
sato
 
Ranch Hand
Posts: 2676
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
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,
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!