I am 110% stumped. I am trying to create a fun applet as a space battle simulator (honor harrington rip off if anyone has read the books). Anyway, this is what it comes to when I am bored at work. Anyway, my issue is that I am trying to read my choice selections when I hit a button (or even if the choice selection changes, I care not which way I achieve it). Anyway, my issue is no matter what I try I can't get a read off of the choice drop down (using choice.getSelectedItem()) within the actionPerformed or itemStateChanged methods.
Here is my code, anyone have any ideas??? By the way, the commented out section is what I had been using, but it wasn't working at all. Thanks.
Here is a sample code that I am trying to get to work (and apply it to my larger applet).
public class sample extends Applet implements ActionListener, ItemListener
public Choice cSamp;
private Button sampButton;
private TextField tf1;
public void init()
Choice cSamp = new Choice();
sampButton = new Button("Change"
tf1 = new TextField(30);
public void itemStateChanged (ItemEvent e)
public void actionPerformed (ActionEvent e)