aspose file tools*
The moose likes Java Micro Edition and the fly likes command button not able to display need help 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 button not able to display need help" Watch "command button not able to display need help" New topic
Author

command button not able to display need help

jawwad ahmed
Ranch Hand

Joined: Dec 01, 2001
Posts: 179
Hi gurus;
Well my project is stuck due the reason that sl45i emulator does not
show any command button when i use textfield with it.
Here is program which i am trying to solve my problem
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class Test extends MIDlet implements CommandListener{
private Display display; // Reference to display object
private Form fmMain; // The main form
private Command cmInsert; // Command to insert items
private Command cmExit; // Command to exit
private DateField dfDate; // Display date
private TextField tfSize; // Product size
private TextField tfQuantity;// Product quantity
private int dateIndex; // Index of dfDate
public Test(){
display = Display.getDisplay(this);
// Create the date and populate with current date
// Define two textfields and two commands
tfSize = new TextField("Enter",null,15, TextField.NUMERIC);
cmInsert = new Command("Insert", Command.SCREEN, 2);
fmMain = new Form("Form Data...");
fmMain.append(tfSize);
fmMain.addCommand(cmInsert);
fmMain.setCommandListener(this);
}

public void startApp(){
display.setCurrent(fmMain);
}
public void pauseApp(){
}
public void destroyApp(boolean unconditional) {
}
public void commandAction(Command c, Displayable s){
}
}
Please i need help.Will be very yhankful.
Jawwad Ahmed
Rishi Tyagi
Ranch Hand

Joined: Feb 14, 2002
Posts: 100
Jawwad,
there is command button on the screen but will be shown to you when you will scroll down.
Actually according to my experience with sl45i when you load some screen like this (you program) then the focus is at your text field while your command is associated with the form so when you will scroll down or up the screen using down/up arrow navigation key on the emulator or on the real phone then focus will be transfered to the form and then your command will be shown to you.
Rishi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: command button not able to display need help
 
Similar Threads
exception with ImageItem
Please check this code !!!!
Doubt from John W.Muchow -core J2ME Technology &MIDP
GUI chat room
J2me brain not found