• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

GUI in J2ME

 
Bob Hendry
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...
 
Valentin Crettaz
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.
 
Nick Knickerbocker
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic