Need help finding bug in this if statement
<p>Disclaimer: this is a (frustrating) homework related problem.</p>

<p>I'm having odd results when I draw my objects on screen. I want this...I draw first object then draw second object when I select third object to draw the screen clears and I have to start the process again....what i get is...I draw first object, I draw second object, I go to draw third object screen clears...I select third object but SECOND object is what appears on screen. Please help point me in right direction.</p>

<pre><code>package ui.panels;

import java.awt.Choice;
import java.awt.Panel;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import model.Model;
import interfaces.Resettable;

public class ChoicePanel extends Panel implements Resettable{
  public int i = 0;
  /**
   * 
   */
  private static final long serialVersionUID = 1L;
  Model model;
  Choice selection;

  public ChoicePanel(Model mdl) {
      model = mdl;
      selection = new Choice();
      for (String msg : Model.selections) {
          selection.add(msg);
      }
      selection.addItemListener(new ItemListener() {

          public void itemStateChanged(ItemEvent e) {
            if(i==1) {//drop down clicked three times)
              System.out.println("ChoicePanel says i == "+i);
              model.setMessage(selection.getSelectedItem());
              model.setCurrentShapeType(selection.getSelectedItem());
              //model.repaint();
              ++i;
            }else if(i==2){
              System.out.println("ChoicePanel says i == "+i);
              model.setMessage(selection.getSelectedItem());
              //model.setCurrentShapeType(selection.getSelectedItem());
              model.resetComponents();
              //--i;
            }else{
              model.setMessage(selection.getSelectedItem());
              //this line is what sends a value to shape that is drawn on screen
              model.setCurrentShapeType(selection.getSelectedItem());
              //model.repaint();
              ++i;
            }
          }

      });
      this.add(selection);
  }

  public void resetComponents() {
    System.out.println("resetComponents from ChoicePanel");
    //this resets the drop down list selection array to the first choice on the list
    selection.select(0);
    //this sets selected item in the selection array set in the above line
    //model.setMessage(selection.getSelectedItem());
    i=0;
    model.repaint();
  }

}
</code></pre>
