notifyMenu.add(notifyAction);
mi = notifyMenu.add(notifyAction); mi.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, Event.CTRL_MASK));
  public ConsoleInternalFrame(NodeComponent node,                               ConsoleNodeListener listener,                              JScrollPane pane,                              JRadioButton statusButton,                              String logFileName) {    super("",   // title          true, //resizable          false, //not closable, because they can't be recreated          true, //maximizable          true);//iconifiable    this.node = node;    this.listener = listener;    this.statusButton = statusButton;    this.logFileName = logFileName;    consoleTextPane = (ConsoleTextPane)pane.getViewport().getView();    //    filter = new ConsoleNodeOutputFilter();    //    listener.setFilter(filter);    // get host component by getting the experiment and     // searching its hosts for one with this node.    Experiment experiment =       (Experiment)getPropertyValue((ConfigurableComponent)node, "Experiment");    HostComponent[] hosts = experiment.getHosts();    for (int i = 0; i < hosts.length; i++) {      NodeComponent[] nodes = hosts[i].getNodes();      for (int j = 0; j < nodes.length; j++) {        if (nodes[j].equals(node)) {          host = hosts[i];          hostName = host.getShortName();          break;        }      }    }    // title is "Node name (host name)"    setTitle("Node " + node.getShortName() + " (" + hostName + ")");    // init menubar    JMenuBar menuBar = new JMenuBar();    // Node menu    JMenu nodeMenu = new JMenu(NODE_MENU);    Action infoAction = new AbstractAction(INFO_ACTION) {      public void actionPerformed(ActionEvent e) {        displayAbout();      }    };    nodeMenu.add(infoAction);    Action cpuUsageAction = new AbstractAction(CPU_USAGE_ACTION) {      public void actionPerformed(ActionEvent e) {      }    };    cpuUsageAction.setEnabled(false);    nodeMenu.add(cpuUsageAction);    Action memoryUsageAction = new AbstractAction(MEMORY_USAGE_ACTION) {      public void actionPerformed(ActionEvent e) {      }    };    memoryUsageAction.setEnabled(false);    nodeMenu.add(memoryUsageAction);    Action historyAction = new AbstractAction(HISTORY_ACTION) {      public void actionPerformed(ActionEvent e) {	history_actionPerformed();      }    };    nodeMenu.add(historyAction);    // Edit menu    JMenu editMenu = new JMenu(EDIT_MENU);    Action copyAction = new AbstractAction(SELECT_ALL_ACTION) {      public void actionPerformed(ActionEvent e) {        copy_actionPerformed();      }    };    copyAction.setEnabled(false);    editMenu.add(copyAction);    editMenu.addSeparator();    Action selectAllAction = new AbstractAction(SELECT_ALL_ACTION) {      public void actionPerformed(ActionEvent e) {        selectAll_actionPerformed();      }    };    editMenu.add(selectAllAction);    editMenu.addSeparator();    findAction = new AbstractAction(FIND_ACTION) {      public void actionPerformed(ActionEvent e) {        find_actionPerformed();      }    };    editMenu.add(findAction);    findNextAction = new AbstractAction(FIND_NEXT_ACTION) {      public void actionPerformed(ActionEvent e) {        findNext_actionPerformed();      }    };    editMenu.add(findNextAction);    // view menu    JMenu viewMenu = new JMenu(VIEW_MENU);    Action displayLogAction = new AbstractAction(DISPLAY_LOG_ACTION) {      public void actionPerformed(ActionEvent e) {        displayLog_actionPerformed();      }    };    displayLogAction.setEnabled(false);    viewMenu.add(displayLogAction);    Action setViewSizeAction = new AbstractAction(SET_VIEW_SIZE_ACTION) {      public void actionPerformed(ActionEvent e) {        setViewSize_actionPerformed();      }    };    viewMenu.add(setViewSizeAction);    Action filterAction = new AbstractAction(FILTER_ACTION) {      public void actionPerformed(ActionEvent e) {        filter_actionPerformed();      }    };    filterAction.setEnabled(false);    viewMenu.add(filterAction);    // control menu    JMenu controlMenu = new JMenu(CONTROL_MENU);    Action startAction = new AbstractAction(START_ACTION) {      public void actionPerformed(ActionEvent e) {      }    };    startAction.setEnabled(false);    controlMenu.add(startAction);    Action moveAction = new AbstractAction(MOVE_ACTION) {      public void actionPerformed(ActionEvent e) {      }    };    moveAction.setEnabled(false);    controlMenu.add(moveAction);    Action stopAction = new AbstractAction(STOP_ACTION) {      public void actionPerformed(ActionEvent e) {      }    };    stopAction.setEnabled(false);    controlMenu.add(stopAction);    Action traceAction = new AbstractAction(STACK_TRACE_ACTION) {      public void actionPerformed(ActionEvent e) {      }    };    traceAction.setEnabled(false);    controlMenu.add(traceAction);    // notify menu    JMenu notifyMenu = new JMenu(NOTIFY_MENU);    notifyAction = new AbstractAction(SET_NOTIFY_ACTION) {      public void actionPerformed(ActionEvent e) {	notify_actionPerformed();      }    };    notifyMenu.add(notifyAction);    Action removeNotifyAction = new AbstractAction(REMOVE_NOTIFY_ACTION) {      public void actionPerformed(ActionEvent e) {	removeNotify_actionPerformed();      }    };    notifyMenu.add(removeNotifyAction);    notifyNextAction = new AbstractAction(NOTIFY_NEXT_ACTION) {      public void actionPerformed(ActionEvent e) {	notifyNext_actionPerformed();      }    };    //    notifyNextAction.setEnabled(false);    notifyMenu.add(notifyNextAction);    Action resetNotifyAction = new AbstractAction(RESET_NOTIFY_ACTION) {      public void actionPerformed(ActionEvent e) {	resetNotifyAction_actionPerformed();      }    };    notifyMenu.add(resetNotifyAction);    menuBar.add(nodeMenu);    menuBar.add(editMenu);    menuBar.add(viewMenu);    menuBar.add(controlMenu);    menuBar.add(notifyMenu);    getRootPane().setJMenuBar(menuBar);    initKeyMap(consoleTextPane);    openFrameCount++;    getContentPane().add(pane);    setSize(300,300);    //Set the window's location.    setLocation(xOffset*openFrameCount, yOffset*openFrameCount);  }