弹出屏幕不起作用

时间:2012-10-19 15:02:04

标签: java blackberry popup

对于下面显示的代码,当我按下Options选项按钮(由optionsButton变量给出)时,没有出现弹出屏幕。我做错了什么?

    optionsButton.setChangeListener(new FieldChangeListener() {
        public void fieldChanged(Field arg0, int arg1) {
            PopupScreen popup = new PopupScreen(new VerticalFieldManager());
            popup.add(new LabelField("Hello!"));
            Border border = BorderFactory.createSimpleBorder(
            new XYEdges(), Border.STYLE_TRANSPARENT);
            popup.setBorder(border);
        }
    });

1 个答案:

答案 0 :(得分:8)

optionsButton.setChangeListener(new FieldChangeListener() {
            public void fieldChanged(Field arg0, int arg1) {
                PopupScreen popup = new PopupScreen(new VerticalFieldManager());
                popup.add(new LabelField("Hello!"));
                Border border = BorderFactory.createSimpleBorder(
                new XYEdges(), Border.STYLE_TRANSPARENT);
                popup.setBorder(border);

                Uiapplication.getUIapplication.pushScreen(popup);
            }
        });