Hello,

I am new to Java, and have been trying to make a program for my college course. I have come to a bit of a dead end.

I am trying to make a JComboBox that is linked to a If statement.

e.g.

I want to make a JComboBox with three options (Natural, Yorkstone and Clay) and then create an If statement for it like (pseudocode):

if (JComboBox = Natural)
type = 1;
else if (JComboBox = Yorkstone);
type = 2;
else
type = 3;


Any ideas would be greatly appreceated.

Thanks in advance.