title: PillPool/KellyPool with java arrays
body: <p>I have been trying to work on a Pill Pool program recently, and have experienced some troubles. First off, for those who don't know: Kelly Pool is a form of pool where each player picks three numbered pills at random (1-15), and knock everyone's numbers in without telling them your pills. I first tried to use the Math.random() method to program this, then I realized I would have to use the shuffle() method on an array. Now I still can't get my two JButtons to effectively display  3 numbers from the shuffled array each time I press a button. </p>
  
  <p>Im a bit of a beginner I guess, so Im new with arrays. Ill add detail if this is to vague a problem.</p>
  
  <pre><code>     import javax.swing.*;
       import java.awt.*;
       import java.util.*;
       import java.util.Random;
        public class Display05 extends JPanel
       {
        Random r = new Random();
         private JLabel label1, label2, label;
          public int v, v1, v2, x, k, a;
           public Display05()
            {
       setLayout(new GridLayout(3, 1));
       Font f = new Font("Serif", Font.BOLD, 30);
       //total = value = 0;
  
       label1 = new JLabel("First Pill: " + v);
       label1.setFont(f);
       label1.setForeground(Color.blue);
       add(label1);
  
       label2 = new JLabel("Second Pill: " + v1);
       label2.setFont(f);
       label2.setForeground(Color.blue);
       add(label2);
  
       label = new JLabel("Third Pill: " + v2);
       label.setFont(f);
       label.setForeground(Color.blue);
       add(label);
  
  
    }
  
  
  
        public static int[] rA(int[] array){
       Random rgen = new Random();
  
       for(int k=0; k&lt;array.length; k++){
       int randPos = rgen.nextInt(array.length);
       int temp = array[k];
       array[k] = array[randPos];
       array[randPos] = temp;
  
  
       }
  
       return array;
     }
    public void udate()
    {
     Arrays.copyOfRange(obj, 0, 3);
     Arrays.copyOfRange(obj, 4, 7);
     Arrays.copyOfRange(obj, 8, 11);
     Arrays.copyOfRange(obj, 12, 15);
  
  
      label1.setText("First Pill " +  );
      label2.setText("Second Pill: " + );
       label.setText("Third Pill: " + );
  
    }
       public void list()
       {
          ArrayList&lt;String&gt; obj = new ArrayList&lt;String&gt;();
       obj.add("1");
       obj.add("2");
       obj.add("3");
       obj.add("4");
       obj.add("5");
       obj.add("6");
       obj.add("7");
       obj.add("8");
       obj.add("9");
       obj.add("10");
       obj.add("11");
       obj.add("12");
       obj.add("13");
       obj.add("14");
       obj.add("15");
       Collections.shuffle(obj);
  
        }
  
  
  
       }
  </code></pre>
  
  <p>I cut out some stuff from my first attempts. Next is the Panel, which I'm pretty sure doesn't need any work.</p>
  
  <pre><code>        import javax.swing.*;
          import java.awt.*;
          import java.awt.event.*;
          public class Panel05 extends JPanel
         {
          private Display05 display;
          public Panel05()
          {
           setLayout(new FlowLayout());
  
           display = new Display05();
            add(display);
  
       JButton button = new JButton("Choose pills");
       button.addActionListener(new Listener());
       add(button);
  
       JButton utton = new JButton("Shuffle Pills");
       utton.addActionListener(new istener());
       add(utton);
  
    }
    private class Listener implements ActionListener
    {
       public void actionPerformed(ActionEvent e)
       {
  
          display.update();         
       }
    }
  
    private class istener implements ActionListener
    {
       public void actionPerformed(ActionEvent e)
       {
  
          display.list();         
       }
     }
  
  
  
  
  
   }
  </code></pre>
  
  <p>I won't include the driver file unless someone thinks it might be useful. It's only like 10 lines of code, and is mostly the same as all my other drivers. 
  Thanks for any help!</p>