0
這是關於Netbeans 7.1平臺的應用程序。繼this tutorial我增加了以下我NodetreeTopComponent的代碼,以改變上下文菜單:更改NodeTree的彈出菜單
@Override
public Action[] getActions() {
return new Action[] {new MyAction()};
}
private static class MyAction extends AbstractAction {
public MyAction() {
putValue (NAME, "New Whatever");
}
@Override
public void actionPerformed(ActionEvent e) {
NewWhateverTopComponent nk = new NewWhateverTopComponent();
nk.setVisible(true);
}
}
不幸的是,這不正是什麼。右鍵單擊我樹中的任何節點,我仍然只獲取默認菜單(複製,屬性)。我監督了什麼?
謝謝你的任何建議。
你是對的。非常感謝。 – 2012-02-09 08:27:07
不客氣,祝你好運。 Node API是要掌握的更具挑戰性的NetBeans API之一。 – 2012-02-09 13:18:34