File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java Micro Edition and the fly likes GUI in J2ME Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Reply Bookmark "GUI in J2ME" Watch "GUI in J2ME" New topic
Author

GUI in J2ME

Bob Hendry
Greenhorn

Joined: Sep 21, 2000
Posts: 19
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

Joined: Aug 26, 2001
Posts: 7610
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.


SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
Nick Knickerbocker
Greenhorn

Joined: Jan 14, 2002
Posts: 3
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

Joined: Aug 26, 2001
Posts: 7610
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.
 
 
subject: GUI in J2ME
 
Threads others viewed
About search in the user interface
swings
populating an array via the user
process of coding
Change Java GUI Interface
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com