如何在Blackberry应用程序中使用软键? [英] How to use Soft Keys in Blackberry Application?

查看:105
本文介绍了如何在Blackberry应用程序中使用软键?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在J2ME中的应用程序中,我刚刚将Emulator Platform更改为Blackberry JDE 6.0.0和Device9800.

My application in J2ME, I have just changed Emulator Platform to Blackberry JDE 6.0.0 and Device 9800.

在Netbeans中应用上述配置后,我得到了MyApp.cod文件.我已经将其安装在设备Blackberry上,但问题是我主要使用Canvas,并且使用功能键进行选择.轨迹球可与Left,UP,Down和amp;一起使用没关系.但是我在画布上提供的软键不起作用?我必须在画布上进行哪些更改才能使用Blackberry的软键?

After applying above configuration in Netbeans I got MyApp.cod file. I have installed it on my device Blackberry but problem is I used mostly Canvas and I used softkeys for options. Trackball working with Left, UP, Down & Right it's fine. But my soft keys which I provided on canvas it's not working? What I have to make changes in my canvas to use soft keys of blackberry?

这里是代码::

     protected void keyPressed(int keyCode) {
        action = getGameAction(keyCode);
        if(keyCode == -7)
        {
            // for go to back
            Display.getDisplay(midlet).setCurrent(midlet.aolMenuCanvas);
        }
        else if(keyCode == -6)
        {
            try {
               //midlet.DownloadPhoto((imageName[index_send]),++index_send);
                 midlet.DownloadPhoto(imgName[index]);
            } catch (IOException ex) {
                ex.printStackTrace();
            }

        }
}

推荐答案

首先查看此问题,它是公认的答案. 您可以向画布添加2个具有相同优先级的命令,并在commandAction(Command cmnd,Displayable dsplbl)方法中处理更改.如果希望隐藏命令的标签,请将canvas全屏模式设置为true.

First look at this question and it's accepted answer.In the other hand you can add 2 commands with the same priority to the canvas and handle your changes in commandAction(Command cmnd, Displayable dsplbl)method.If you want that your command's labels be hidden,set canvas full screen mode to true.

这篇关于如何在Blackberry应用程序中使用软键?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆