lcdui 与 lwuit 命令区别

发布于 2024-11-18 11:43:18 字数 1464 浏览 4 评论 0原文

我习惯使用 lcdui 界面,但我想使用 lwuit 界面。 谁能告诉我不同​​的命令列表。

  package newpackage;

import java.io.IOException;
import javax.microedition.midlet.*;
import com.sun.lwuit.*;
import com.sun.lwuit.events.*;
import com.sun.lwuit.plaf.UIManager;
import com.sun.lwuit.util.Resources;

public class test extends MIDlet implements ActionListener {
Form mainform;
List list;
Command exit = new Command ("Exit");



 public void startApp() {

        Display.init(this);
        try {
  Resources r = Resources.open("/res/javaTheme.res");
  UIManager.getInstance().setThemeProps(r.getTheme("javaTheme"));
} catch (IOException ioe) {
 // Do something here.
}
        mainform = new Form("MENU");
        list = new List();
        list.addItem("Remitting");
        list.addItem("Paying");
        list.addItem("Change Pin");
        list.addItem("Inbox");

        mainform.addComponent(list);
        mainform.show();
        mainform.addCommand(exit);
        mainform.setCommandListener(this);




 }

 public void pauseApp() {}

 public void destroyApp(boolean unconditional) {}

 public void actionPerformed(ActionEvent ae) {

 if (ae.getCommand()== exit){
    destroyApp(false);
    notifyDestroyed();
   }

 if (ae.getSource()==list){
  switch(list.getSelectedIndex()){
   case 0:
       Remitting();
        break;
   case 1:
       Paying();
       break;
   case 2:
       Changepin();
       break;
   case 3:
       Inbox();
       break;
    }

i am used to working with lcdui interface but i want to work with lwuit interface.
Can any one tell me the different command list.

  package newpackage;

import java.io.IOException;
import javax.microedition.midlet.*;
import com.sun.lwuit.*;
import com.sun.lwuit.events.*;
import com.sun.lwuit.plaf.UIManager;
import com.sun.lwuit.util.Resources;

public class test extends MIDlet implements ActionListener {
Form mainform;
List list;
Command exit = new Command ("Exit");



 public void startApp() {

        Display.init(this);
        try {
  Resources r = Resources.open("/res/javaTheme.res");
  UIManager.getInstance().setThemeProps(r.getTheme("javaTheme"));
} catch (IOException ioe) {
 // Do something here.
}
        mainform = new Form("MENU");
        list = new List();
        list.addItem("Remitting");
        list.addItem("Paying");
        list.addItem("Change Pin");
        list.addItem("Inbox");

        mainform.addComponent(list);
        mainform.show();
        mainform.addCommand(exit);
        mainform.setCommandListener(this);




 }

 public void pauseApp() {}

 public void destroyApp(boolean unconditional) {}

 public void actionPerformed(ActionEvent ae) {

 if (ae.getCommand()== exit){
    destroyApp(false);
    notifyDestroyed();
   }

 if (ae.getSource()==list){
  switch(list.getSelectedIndex()){
   case 0:
       Remitting();
        break;
   case 1:
       Paying();
       break;
   case 2:
       Changepin();
       break;
   case 3:
       Inbox();
       break;
    }

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

独自←快乐 2024-11-25 11:43:18

您正在添加到列表中。列表不是命令。两者是不同的。阅读这篇文章LWUIT 简介

You are adding into List. List not a Command. Both are different. Read this article, Introduction about LWUIT.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文