title: How do I find the min, max and avg values from a (double) ArrayList to open a GUI (graph)?
body: <p>For Full Context:
  This is code within a JFrame class/JButton used to open up data and to present a content pane that allows its user to open up a graph once a certain button within it is clicked (so the code is within an ActionListener). All code related to opening the graph (which is also on a seperate class) itself works fine.</p>
  
  <p>The content pane also allows its user to open up a CSV file with the same data by clicking on a radio button that says 'CSV' and clicking on a button labelled as 'Load', another button that says 'Show' allows the data within those files to be posted on an (AWT) text area. This has already been done without any issues whatsoever. </p>
  
  <p>Since there are thousands of rows in each column of the files (so a lot of data basically), I need to find the minimum, maximum, and averages of a couple of the columns in them. The 'mm' and 'temperature' columns are two contents of a datalist in a seperate class in the same package.</p>
  
  <pre><code>JButton btnMinMaxAvg = new JButton("Min/Max/Avg");
  
     btnMinMaxAvg.addActionListener(new ActionListener() {
  
         public void actionPerformed(ActionEvent e) {
  
  
          ArrayList&lt;Double&gt; mm = new ArrayList&lt;Double&gt;();
          ArrayList&lt;Double&gt; temperature = new ArrayList&lt;Double&gt;();
  
          for(data f: dataList){
              mm.add(f.getMm());
              temperature.add(f.getTemperature());
  
              LineChartData l = new LineChartData("Plot Data");
              l.setMm(mm);
                  l.setTemperature(Temperature);
  
              l.plot();
  
                 }
  
      });
          btnMinMaxAvg.setBounds(315, 65, 89, 23);
          contentPane.add(btnMinMaxAvg);
  
  
  }
  </code></pre>
  
  <p>The above code simply opens a graph containing the values of these columns, but I've been having trouble finding the minimum, maximum, and average values. Even information regarding one of these would be extremely helpful. Thank you.</p>