0
這裏是我的特拉弗斯方法的代碼導線自定義GUI在J2ME
protected boolean traverse(int dir, int viewportWidth, int viewportHeight,
int[] visRect_inout) {
try {
if (hori && vert) {
// CustomItems items=new CustomItems("Hi");
switch (dir) {
case Canvas.DOWN:
this.a=dir; //Canvas.DOWN
this.b=viewportWidth; //b=2
this.c=viewportHeight; //c=3
this.d=visRect_inout; //d={2,2,250,250}
this.traverse(Canvas.UP, b, c, d);
break;
case Canvas.UP:
this.a=dir;
this.j=viewportWidth;
this.k=viewportHeight;
this.d=visRect_inout;
this.traverse(Canvas.UP, j, k, d);
break;
case Canvas.LEFT:
this.a=dir;
this.j=viewportWidth;
this.k=viewportHeight;
this.d=visRect_inout;
this.traverse(Canvas.LEFT, j, k, d);
break;
case Canvas.RIGHT:
break;
}
}
} catch (Exception e) {
System.out.println("Exception " + e);
}
return false;
}
我是很新的自定義項。
如果我做錯了,請告訴我。
什麼是_CustomGUI_?什麼是_Listitem_? [MIDP 2 lcdui API]中沒有這樣的對象(http://docs.oracle.com/javame/config/cldc/ref-impl/midp2.0/jsr118/javax/microedition/lcdui/package-summary.html )。你的意思是'CustomItem'和'ChoiceGroup'? – gnat
@ user1078616,你的問題非常模糊和不確定。用更具體的上下文支持你的問題,屏幕截圖,提及參考庫和使用的開發環境。 – Vimal