invisButton = new JToggleButton("Invisible");
  private JPanel createNodePanel(String description) {    // create panel which contains description panel, status button panel, and tabbed panes    JPanel panel = new JPanel(new GridBagLayout());    // descriptionPanel contains society name, control buttons    JPanel descriptionPanel = createHorizontalPanel(true);    descriptionPanel.add(Box.createRigidArea(VGAP30));    descriptionPanel.add(Box.createRigidArea(HGAP10));    descriptionPanel.add(new JLabel(description));    descriptionPanel.add(Box.createRigidArea(HGAP5));    attachButton = new JToggleButton("Attach");    attachButton.setToolTipText("Attach to running nodes");    attachButton.addActionListener(new ActionListener() {      public void actionPerformed(ActionEvent e) {        attachStateChanged();      }    });    attachButton.setFocusPainted(false);    attachButton.setEnabled(true);    descriptionPanel.add(attachButton);    descriptionPanel.add(Box.createRigidArea(HGAP5));    runButton = new JToggleButton("Run");    runButton.setToolTipText("Start running experiment");    runButton.addActionListener(new ActionListener() {      public void actionPerformed(ActionEvent e) {        runStateChanged();      }    });    runButton.setFocusPainted(false);    descriptionPanel.add(runButton);    descriptionPanel.add(Box.createRigidArea(HGAP5));    invisButton = new JToggleButton("Invisible");    stopButton = new JToggleButton("Stop");    stopButton.setToolTipText("Halt experiment at end of current");    stopButton.addActionListener(new ActionListener() {      public void actionPerformed(ActionEvent e) {        runStateChanged();      }    });    stopButton.setFocusPainted(false);    descriptionPanel.add(stopButton);    descriptionPanel.add(Box.createRigidArea(HGAP5));    // Sets up a ButtonGroup to handle toggling between buttons.    runningState = new ButtonGroup();    runningState.add(runButton);    runningState.add(stopButton);    runningState.add(invisButton);    // create progress panel for time labels    // these are referenced elsewhere, so are created even if not displayed    JPanel runProgressPanel = createHorizontalPanel(false);    final JLabel experimentTimeLabel = new JLabel("Experiment: 00:00:00");    JPanel progressPanel = new JPanel(new GridBagLayout());    runProgressPanel.add(experimentTimeLabel);    progressPanel.add(runProgressPanel,                      new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0,                                             GridBagConstraints.WEST,                                             GridBagConstraints.HORIZONTAL,                                             new Insets(0, 0, 0, 0),                                             0, 0));    descriptionPanel.add(Box.createRigidArea(HGAP10));    descriptionPanel.add(progressPanel);    descriptionPanel.add(Box.createRigidArea(HGAP10));    // add description panel to top panel    panel.add(descriptionPanel,              new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0,                                     GridBagConstraints.WEST,                                     GridBagConstraints.HORIZONTAL,                                     new Insets(0, 10, 2, 10),                                     0, 0));    // create status button panel, initially with no buttons    buttonPanel = createHorizontalPanel(true);    buttonPanel.add(Box.createRigidArea(HGAP10));    buttonPanel.add(new JLabel("Node Status"));    buttonPanel.add(Box.createRigidArea(HGAP10));    buttonPanel.add(Box.createRigidArea(VGAP30));    JScrollPane jsp = new JScrollPane(buttonPanel);    // ensure the layout leaves space for the scrollbar    jsp.setMinimumSize(new Dimension(100, 50));    panel.add(jsp,              new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0,                                     GridBagConstraints.WEST,                                     GridBagConstraints.HORIZONTAL,                                     new Insets(0, 10, 0, 10),                                     0, 0));    statusButtons = new ButtonGroup();    nodeMenu = new JPopupMenu();    Action aboutAction = new AbstractAction(ABOUT_ACTION) {      public void actionPerformed(ActionEvent e) {        displayAboutNode();      }    };    nodeMenu.add(aboutAction);    Action resetAction = new AbstractAction(RESET_ACTION) {      public void actionPerformed(ActionEvent e) {        resetNodeStatus();      }    };    Action legendAction = new AbstractAction(LEGEND_MENU_ITEM) {      public void actionPerformed(ActionEvent e) {        legend.setVisible(true);      }    };    nodeMenu.add(resetAction);    nodeMenu.addSeparator();    nodeMenu.add(legendAction);    // create tabbed panes for configuration information (not editable)//    if (experiment != null) {//      hostConfiguration = new HostConfigurationBuilder(experiment, null);//      hostConfiguration.update(); // display configuration//      hostConfiguration.addHostTreeSelectionListener(myTreeListener);//      JInternalFrame jif = new JInternalFrame(configWindowTitle,//                                              true, false, true, true);//      jif.getContentPane().add(hostConfiguration);//      jif.setSize(660, 400);//      jif.setLocation(0, 0);//      jif.setVisible(true);//      desktop.add(jif, JLayeredPane.DEFAULT_LAYER);//    }    panel.add(desktop,              new GridBagConstraints(0, 2, 1, 1, 1.0, 1.0,                                     GridBagConstraints.WEST,                                     GridBagConstraints.BOTH,                                     new Insets(0, 0, 0, 0),                                     0, 0));    return panel;  }