2016-05-19 5 views
1

removeCommandとremoveAllCommandが機能していません。私はそれをボタンアクションリスナーremoveCommand(コマンド)が動作しますが、removeAllcommand()が動作していない場合は? バグですか?チェックアウトしてください。ありがとうremoveCommandがツールバーコマンドに対して機能していません - codenameone

Command d = new Command("back") { 

     @Override 
     public void actionPerformed(ActionEvent evt) { 
     } 
}; 
f.setBackCommand(d); 
f.getToolbar().addCommandToLeftBar(d); 
//Either of these two doesnt remove above back command... 
f.removeAllCommands(); 
f.removeCommand(d); 

私はアクションリスナーに入れて、そのうちの一つは、

Button add = new Button("remove"); 
    add.addActionListener((e) -> { 
     f.removeCommand(d);// it removes back command 
     f.removeAllCommands(); // it doesnt work 
}); 

答えて

1

フォームに

Button add = new Button("remove"); 
add.addActionListener((e) -> { 
      f.removeAllCommands(); 
      f.revalidate(); 
}); 
を再検証してみ働く場合
関連する問題