BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 05-27-2010, 01:02 AM   #1
Emmett
New Member
 
Join Date: Feb 2009
Model: 9700
PIN: N/A
Carrier: SFR
Posts: 3
Default MIDlet button working differently on a BlackBerry 9700 than on the SUN WTK simulator

Please Login to Remove!

Hi,

I am trying to design a 2 button interface using MIDlet 2.0 and CLDC 1.1 but get a different behaviour on the WTK simulator and on a BlackBerry 9700.
On the WTK simulator, the command behind the button is fired as soon as the button is pressed through the trackpad.
On a BlackBerry 9700, the first click on the button through the trackpad brings up the screen command menu and a second click on the command listed in this menu and linked to the button is necessary.
How can I make the BlackBerry 9700 work as with the WTK simulator, i.e. fire the command as soon as the button is pressed through the trackpad?
I wish to stay on the JME model and not going to the RIM SDK.

Thanks

package UI;

import javax.microedition.lcdui.Alert;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.Item;
import javax.microedition.lcdui.StringItem;
import javax.microedition.lcdui.ItemCommandListener;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeExcepti on;

public class MyButton extends MIDlet implements ItemCommandListener {
Display display;
Form form;
Command okCommand, exitCommand;
protected void startApp() throws MIDletStateChangeException {
display = Display.getDisplay(this);

form=new Form("2 button interface");

StringItem okButton=new StringItem(null, "Ok", Item.BUTTON);
okButton.setItemCommandListener(this);
okCommand=new Command("Ok",Command.ITEM, 0);
okButton.setDefaultCommand(okCommand);
okButton.addCommand(okCommand);
form.append(okButton);

StringItem exitButton=new StringItem(null, "Exit", Item.BUTTON);
exitButton.setItemCommandListener(this);
exitCommand=new Command("Exit",Command.ITEM, 0);
exitButton.setDefaultCommand(exitCommand);
exitButton.addCommand(exitCommand);
form.append(exitButton);

display.setCurrent(form);
}

public void commandAction(Command cmd, Item item) {
Alert alert=new Alert("Button pressed "+cmd.getLabel()+" "+item.toString());
display.setCurrent(alert);
}
protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
this.notifyDestroyed();
}

protected void pauseApp() {
}

}
Offline  
Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


Schneider Electric Energy Server EBX510 Server For Energy Management- picture

Schneider Electric Energy Server EBX510 Server For Energy Management-

$4350.00



FANUC Server Driver A06B-6077-H111 picture

FANUC Server Driver A06B-6077-H111

$2158.86



FANUC Server Driver A06B-6117-H211 picture

FANUC Server Driver A06B-6117-H211

$3993.99



Lot of 6 Server Syrup Flavoring Manual Pumps Stainless with Plastic Containers picture

Lot of 6 Server Syrup Flavoring Manual Pumps Stainless with Plastic Containers

$150.00



For DELL T140 Tower Server Motherboard 00RG5V picture

For DELL T140 Tower Server Motherboard 00RG5V

$300.00



USA Windows VPS Server / RDP Server / VPS Hosting 12GB RAM 400GB HDD 12 Month picture

USA Windows VPS Server / RDP Server / VPS Hosting 12GB RAM 400GB HDD 12 Month

$335.00







Copyright © 2004-2016 BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of BlackBerry Inc.