title: Simon Says won't show sequence
body: <p>Below is a Simon Says program I am working on. Right now it only displays a gray frame. I added in a keyListener to see if i could make the arcs light up.I wanted to display a flash animation sequence. Why isn't this working?</p>
  <pre><code>public class SimonShape extends JFrame implements KeyListener, ActionListener      {  
  
  private JFrame f;
  private JPanel p;
  
  public static void main(String[] args) {
      new SimonShape();
  }
  
  public SimonShape() {
  
      f = new JFrame(&quot;Simon Says&quot;);
      f.setSize(500, 500);
      f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      DrawStuff draw = new DrawStuff();
  
      p = new JPanel();
      p.setBackground(Color.GRAY);
      p.setLayout(new BorderLayout());
      draw.playSequence();
      p.add(draw, BorderLayout.CENTER);
      // initiates the sequence
      f.add(p);
      f.addKeyListener(this);
      f.setLocationRelativeTo(null); // positions the frame in the middle of
                                      // the screen
  
  
      f.setVisible(true);
  
  }
  
  public class DrawStuff extends JComponent {
  
      Color COLOR1;
      Color COLOR2;
      Color COLOR3;
      Color COLOR4;
  
      public void playSequence() {
  
          ArrayList&lt;Integer&gt; Computer = new ArrayList&lt;Integer&gt;();
          ArrayList&lt;Integer&gt; Player = new ArrayList&lt;Integer&gt;();
  
          int compPick, compPick2, compPick3, compPick4;
  
          Random gen = new Random();
  
          compPick = gen.nextInt(4);
          compPick2 = gen.nextInt(4);
          compPick3 = gen.nextInt(4);
          compPick4 = gen.nextInt(4);
  
          Computer.add(compPick);
          Computer.add(compPick4);
          Computer.add(compPick2);
          Computer.add(compPick3);
          
          for (int i = 0; i &lt; Computer.size(); i++) {
  
              if (Computer.get(i) == 0) {
                  COLOR1 = Color.GREEN.brighter();
                  repaint();
              } else if (Computer.get(i) == 1) {
                  COLOR2 = Color.BLUE.darker();
                  repaint();
  
              } else if (Computer.get(i) == 2) {
                  COLOR3 = Color.RED.darker();
                  repaint();
  
              } else if (Computer.get(i) == 3) {
                  COLOR4 = Color.YELLOW.brighter();
                  repaint();
              }
          }
  
      }
  
  }
  
  public int flash = 0;
  
  public void paint(Graphics g) {
  
      Graphics2D g2 = (Graphics2D) g;
      Graphics2D g3 = (Graphics2D) g;
      Graphics2D g4 = (Graphics2D) g;
      Graphics2D g5 = (Graphics2D) g;
  
      // assume d == 145 &amp;&amp; e == 90
  
      if (flash == 1) {
          g2.setPaint(Color.GREEN);
      } else {
          g2.setPaint(Color.GREEN.darker());
  
      }
      g2.fill(new Arc2D.Double(150, 150, 200, 200, 145, 90, Arc2D.PIE));
      if (flash == 2) {
          g3.setPaint(Color.BLUE);
      } else {
          g3.setPaint(Color.BLUE.darker());
      }
      g3.fill(new Arc2D.Double(150, 150, 200, 200, 235, 90, Arc2D.PIE));
  
      if (flash == 3) {
          g4.setPaint(Color.RED);
      } else {
          g4.setPaint(Color.RED.darker());
      }
      g4.fill(new Arc2D.Double(150, 150, 200, 200, 325, 90, Arc2D.PIE));
      if (flash == 4) {
          g5.setPaint(Color.YELLOW);
      } else {
          g4.setPaint(Color.YELLOW.darker());
      }
      g5.fill(new Arc2D.Double(150, 150, 200, 200, 55, 90, Arc2D.PIE));
  
  }
  public void keyPressed(KeyEvent e) {
  
      int event = e.getKeyCode();
  
      if (event == KeyEvent.VK_RIGHT) {
          flash = 1;
      }
      if (event == KeyEvent.VK_DOWN) {
          flash = 2;
      }
      if (event == KeyEvent.VK_LEFT) {
          flash = 3;
      }
      if (event == KeyEvent.VK_UP) {
          flash = 4;
      }
  }
  
  @Override
  public void keyTyped(KeyEvent e) {//not used
  
  }
  
  @Override
  public void keyReleased(KeyEvent e) {//not used
  
  }
  
  @Override
  public void actionPerformed(ActionEvent e) {//not used 
  
  }
  
  }
  </code></pre>