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 Command buttons display on screen Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Command buttons display on screen" Watch "Command buttons display on screen" New topic

Command buttons display on screen

Priety Sharma
Ranch Hand

Joined: Jun 10, 2008
Posts: 156

I have a midlet with 2 screens.
Screen one is a form which has 2 StringItems and 1 TextField in that sequence.
The StringItems display simple text messages.
The Textfield is a initialized as follows:

I have added 2 Commands to the initial screen. One for exit to close the application. One "Ok" Command to go to the 2nd screen.
One BACK command to the 2nd screen to return to the 1st screen.

I have attached an image of the 1st screen when I have clicked on menu button and the menu is getting displayed.

Since there are only 2 commands on this screen Exit and Ok. I want on command to be displayed at the bottom left corner and one on the bottom right corner insted of the menu getting displayed.
How do I achieve this?

My code is as follows:

Please help.

[Thumbnail for storenumber.JPG]

Pramod P Deore
Ranch Hand

Joined: Jul 15, 2008
Posts: 632

I think you can't do that in j2me. I am not very much sure, but it may possible on some mobiles one command may be display on bottom right and one at bottom left , but on some mobile it display as a menu.

Life is easy because we write the source code.....
Priety Sharma
Ranch Hand

Joined: Jun 10, 2008
Posts: 156


Yeah when I put it on my sony ericsson W810i it showed as 2 different buttons, one at the left bottom corner and one at the right bottom corner.

This is not happening with the emulator.

Gopinath Karyadath
Ranch Hand

Joined: Oct 14, 2009
Posts: 87
try with

private Command exit = new Command("Exit", Command.EXIT,0);

I agree. Here's the link:
subject: Command buttons display on screen
It's not a secret anymore!