在我试图在信道上建立一个检查箱时,我遇到麻烦。
我的检查箱运转良好,但我不知道如何储存每个项目的价值,这意味着当用户检查第1行时,然后转到另一个浏览箱,仍然检查第1行和2行的用户,然后转到另一行,检查箱将检查第1和第2行。
但我无法找到解决这一问题的办法。
在我试图在信道上建立一个检查箱时,我遇到麻烦。
我的检查箱运转良好,但我不知道如何储存每个项目的价值,这意味着当用户检查第1行时,然后转到另一个浏览箱,仍然检查第1行和2行的用户,然后转到另一行,检查箱将检查第1和第2行。
但我无法找到解决这一问题的办法。
修改您的代码,以使用。 about array array
// ...initialization of DataList
boolean[] selectTodelete = new boolean[2]; // instead of int
{ selectTodelete[0] = selectTodelete[1] = false; } // init array
Command editCommand, backCommand,selectCmd, unselectCmd,selectAll;
//...
protected void paint(Graphics g) {
//...
for(int i =0 ; i<countRow; i++ ){
//draw background
//...
if(selectTodelete[i]){ // was selectTodelete == 1
//draw select dot at location for row i
//...
}
// remove: you don t need that anymore: if(selectTodelete == 2) {
//draw select dot...
//}
// draw a checkbox before each item
// ...
}
}
public void commandAction(Command c, Displayable d) {
//...
if(c == selectCmd){
selectTodelete[selectedItem] = true;
}
if(c== unselectCmd){
selectTodelete[selectedItem] = false;
}
if(c == selectAll){
selectTodelete[0] = selectTodelete[1] = true;
}
repaint();
}
//...
}
我想让国际协力事业团进行核查,这意味着当监听时,我会得到这种检查,而当我删除指挥时,它将删除所有囚室。
为此,你可以发现<条码>选择Todelete,在课外使用,但需使用以下方法:
boolean isSelected(int elementNum) {
return elementNum >= 0 && elementNum < selectTodelete.length
&& selectTodelete[elementNum];
} // modelled after javax.microedition.lcdui.Choice.isSelected
......在你需要时,如在以下方法中,可进一步利用类似信息:
Vector useSelection(DataList dataList, DataStore[][] ds) {
Vector result = new Vector();
int count = ds.length;
for(int i = 0; i < count; i++ ) {
if (!dataList.isSelected(i)) {
continue; // skip non selected
}
System.out.println("RCID selected: [" + ds[i][5].cellText + "]");
result.addElement(ds[i][5]);
}
return result;
}
I am getting parser exception as "Expecting End of File" while parsing xml data for Blackberry application? How do I fix it?
ok i made a midlet through which i can connect to server pages and get soem information as response. For example i made a midlet through which i acced url: http://example.com/?u=nepal&t=1 Now i ...
I have a JavaME project in Eclipse (Pulsar 3.5; Galileo). I have another project with common code in it in the same workspace and this is referenced from my app. When I choose package app it ...
Given private final Vector v = new Vector(); //instance variable the following 3 lines are in an instance method in the same class. 1. int length = v.capacity(); 2. int size = v.size(); ...
I m using Sun WTK to run a midlet that needs to send and optionally receive SMS. WMA console can be used to send and receive messages to the midlet but I d like to do the same thing using my own ...
It seems to be the consensus that developing for Java ME is not as cross platform as you might expect, particularly compared to say java SE, but it is difficult to assess how the situation is evolving....
I m writing a Java ME app that will use privileged operations such as messaging. By default the user is prompted to confirm each of these operations, but I would like to run it as a background ...
I am trying to use the hessian j2me implementation @ http://hessian.caucho.com/ using java me sdk 3.0. http://hessian.caucho.com/doc/hessian-overview.xtp#Hessian%20Client%20for%20a%20cell-phone ...