2

我在 J2ME 中开发,我需要显示一个文本,然后是人们可以按下的带下划线的链接/按钮。

我不能使用画布。

作为临时解决方案,我使用的是典型的命令按钮,但我想在屏幕上显示此选项。

(我不想使用任何暗示改变一切的框架,使其具有特定的外观,只有带下划线的链接)

4

1 回答 1

3

找到了,呵呵!!!

Command  prospectoCommand = new Command("Prospecto", Command.EXIT, 1);

                         StringItem messageItem2 = new StringItem("", "", Item.HYPERLINK);

                         messageItem2.setText("push to go to the URL");

ItemCommandListener listener = new ItemCommandListener() {

                    public void commandAction(Command cmnd, Item item) {

                        if(cmnd==prospectoCommand)
                        {
                            try {
                                midlet.platformRequest(URL);
                            } catch (ConnectionNotFoundException ex) {
                                ex.printStackTrace();
                            }

                        }


                    }
                };

                    messageItem2.setDefaultCommand(prospectoCommand);
于 2010-08-19T12:04:25.817 回答