@Override
  public void valueChanged(TreeSelectionEvent e) {

    DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent();

    if (node == null) {
      return;
    }

    Object nodeInfo = node.getUserObject();
    // tree leaf
    if (node.isLeaf()) {
      ChartInfo chartInfo = (ChartInfo) nodeInfo;
      // displayURL(chartInfo.bookURL);
      chartPanel = new XChartPanel(chartInfo.getExampleChart());
      splitPane.setBottomComponent(chartPanel);

      // start running a simulated data feed for the sample real-time plot
      timer.cancel(); // just in case
      if (chartInfo.getExampleChartName().startsWith("RealtimeChart01")) {
        // set up real-time chart simulated data feed
        TimerTask chartUpdaterTask = new TimerTask() {

          @Override
          public void run() {

            realtimeChart01.updateData();
            chartPanel.revalidate();
            chartPanel.repaint();
          }
        };
        timer = new Timer();
        timer.scheduleAtFixedRate(chartUpdaterTask, 0, 500);
      }
      else if (chartInfo.getExampleChartName().startsWith("RealtimeChart02")) {
        // set up real-time chart simulated data feed
        TimerTask chartUpdaterTask = new TimerTask() {

          @Override
          public void run() {

            realtimeChart02.updateData();
            chartPanel.revalidate();
            chartPanel.repaint();
          }
        };
        timer = new Timer();
        timer.scheduleAtFixedRate(chartUpdaterTask, 0, 500);
      }
      else if (chartInfo.getExampleChartName().startsWith("RealtimeChart03")) {
        // set up real-time chart simulated data feed
        TimerTask chartUpdaterTask = new TimerTask() {

          @Override
          public void run() {

            realtimeChart03.updateData();
            chartPanel.revalidate();
            chartPanel.repaint();
          }
        };
        timer = new Timer();
        timer.scheduleAtFixedRate(chartUpdaterTask, 0, 500);
      }
      else if (chartInfo.getExampleChartName().startsWith("RealtimeChart04")) {
        // set up real-time chart simulated data feed
        TimerTask chartUpdaterTask = new TimerTask() {

          @Override
          public void run() {

            realtimeChart04.updateData();
            chartPanel.revalidate();
            chartPanel.repaint();
          }
        };
        timer = new Timer();
        timer.scheduleAtFixedRate(chartUpdaterTask, 0, 500);
      }
      else if (chartInfo.getExampleChartName().startsWith("RealtimeChart05")) {
        // set up real-time chart simulated data feed
        TimerTask chartUpdaterTask = new TimerTask() {

          @Override
          public void run() {

            realtimeChart05.updateData();
            chartPanel.revalidate();
            chartPanel.repaint();
          }
        };
        timer = new Timer();
        timer.scheduleAtFixedRate(chartUpdaterTask, 0, 500);
      }
    }
  }