• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

command button not able to display need help

 
Ranch Hand
Posts: 179
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic