code: private JComponent createControls(boolean islands)
      {
          JPanel controls = new JPanel(new FlowLayout(FlowLayout.RIGHT));
  
          allDataButton.addItemListener(new ItemListener()
          {
              public void itemStateChanged(ItemEvent ev)
              {
                  updateDomainAxisRange();
              }
          });
          String text = "Last " + SHOW_FIXED_GENERATIONS + (islands ? " Epochs" : " Generations");
          JRadioButton recentDataButton = new JRadioButton(text, true);
          ButtonGroup buttonGroup = new ButtonGroup();
          buttonGroup.add(allDataButton);
          buttonGroup.add(recentDataButton);
  
          controls.add(allDataButton);
          controls.add(recentDataButton);
  
          final JCheckBox meanCheckBox = new JCheckBox("Show Mean", true);
          meanCheckBox.addItemListener(new ItemListener()
          {
              public void itemStateChanged(ItemEvent itemEvent)
              {
                  if (itemEvent.getStateChange() == ItemEvent.SELECTED)
                  {
                      dataSet.addSeries(meanSeries);
                  }
                  else
                  {
                      dataSet.removeSeries(meanSeries);
                  }
              }
          });
          controls.add(meanCheckBox);
  
          invertCheckBox.addItemListener(new ItemListener()
          {
              public void itemStateChanged(ItemEvent itemEvent)
              {
                  rangeAxis.setInverted(invertCheckBox.isSelected());
              }
          });
          controls.add(invertCheckBox);
  
          return controls;
      }
docs: Creates the GUI controls for toggling graph display options.
  @return A component that can be added to the main panel.