2012-10-19 89 views
0

對於下面所示的代碼,當我按下選項按鈕(通過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); 
     } 
    }); 
+0

你需要按彈出屏幕Anzy_建議 – mrvincenzo

回答

9
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); 
      } 
     }); 
+1

當你與你的彈出屏幕做,你可以刪除它以同樣的方式。使用** Uiapplication.getUIapplication.popScreen(彈出); ** –