Win a copy of Pragmatic AI this week in the Artificial Intelligence forum!
  • 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:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

GUI in J2ME  RSS feed

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I am using forms with GUI components on Palm devices. It seems that there is no Layout Management. Is there a way I can specifiy x/y coordinates for (say) when I add a Textbox or Images?
Tx!
Bob...
 
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You cannot specify the location of a TextBox, but you can ask where to display an image, though.
Use the static field members of the ImageItem class, that is:
- ImageItem.LAYOUT_CENTER // horizontally centers the image
- ImageItem.LAYOUT_DEFAULT // uses the default formatting of the container
- ImageItem.LAYOUT_LEFT // draws the image close to the left border of the drawing area
- ImageItem.LAYOUT_NEWLINE_AFTER // everything drawn after the image comes under the image
- ImageItem.LAYOUT_NEWLINE_BEFORE // the image is automatically drawn under a preceding text
- ImageItem.LAYOUT_RIGHT // draws the image close to the right border of the drawing area
Be aware, though, that those constraints are only hints and they may be ignored by the underlying implementation.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for that information Valentin. This concerns me because I am looking at a table layout for the GUI of a PDA-based software product. The easiest comparison I can make would be a high-speed rating system.

The user must only tap their stylus in the correct column for each person, thus allowing the fastest possible entry of information.
The way you explained the ImageItem constants, it seems I would not be able to rely on J2ME to place my user interface elements exactly where I want them. Help?
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would probably try investigating the ChoiceGroup class in package javax.microedition.lcdui which provides such functionalities. I'm not sure that you may be able to achieve your goal, though, but it sure is worth trying.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!