In my java code I get this error. Enyone fix it for me Plz?

cannot find symbol :method getSelectedItem()

This is my code.

import java.awt.*;
import java.awt.event.*;
import java.applet.*;

public class soda extends Applet implements ActionListener, ItemListener {
Label lblhead,lblfoot,lblsize,lbltype,lblamt,lblbal,lblavilability;
Button b1,b2,b3,b4,b5,b6,b7,btnref;
Choice choice1;
Checkbox ch1,ch2,ch3,ch4,ch5;
float num,money,change;
CheckboxGroup cbg,cbg1;
TextField txtamt1,txtbal,txtfoot,txtavilability;

float itemprice=20;

public int cola_10oz_reg =3;
public int cola_10oz_die =3;
public int cola_16oz_reg =3;
public int cola_16oz_die =3;
public int org_10oz_reg =3;
public int org_16oz_reg =3;
public int org_10oz_die =3;
public int org_16oz_die =3;
public int lim_10oz_reg =3;
public int lim_16oz_reg =3;

public void init() {

lblhead = new Label();

cbg = new CheckboxGroup();
ch1 = new Checkbox("COLA", cbg, false);
ch2 = new Checkbox("ORANGE", cbg, false);
ch3 = new Checkbox("LIME", cbg, false);

b1 = new Button();
b2 = new Button();
b3 = new Button();
b4 = new Button();
b5 = new Button();
b6 = new Button();
b7 = new Button();

choice1 = new Choice();

lblsize = new Label();
lbltype = new Label();

cbg1 = new CheckboxGroup();
ch4 = new  Checkbox("Regular", cbg, true);
ch5 = new Checkbox("Diet", cbg, false);

lblamt = new Label();
txtamt1 = new TextField();
lblbal = new Label();
txtbal = new TextField();
btnref = new Button();
txtfoot = new TextField();
lblavilability = new Label();
txtavilability = new TextField();

setBackground(new Color(255, 153, 153));
setLayout(null);

lblhead.setAlignment(Label.CENTER);
lblhead.setFont(new Font("Calibri", 1, 18));
lblhead.setText("Soda Vending Machine");
add(lblhead);
lblhead.setBounds(80, 30, 230, 30);

add(ch1);
ch1.setBounds(60, 70, 58, 20);

add(ch2);
ch2.setBounds(60, 100, 77, 20);

add(ch3);
ch3.setBounds(60, 130, 53, 20);

b1.setBackground(new Color(0, 153, 153));
b1.setLabel("RM ...

This button is not working. why is that?

if(e.getSource()==btnref){
txtamt1.setText(null);
txtbal.setText(null);
}

I've soome buttons in my coding. It has some values. I want to add those val & display in a text box. When u press a button the amt has to be calculated. I tried bt it's not working.How can I do this? I need quick reply. This is my code.

import java.awt.*;
import java.awt.event.*;
import java.applet.*;

public class soda extends Applet implements ActionListener, ItemListener {
Label lblhead,lblfoot,lblsize,lbltype;
Button b1,b2,b3,b4,b5,b6,b7,btnbal;
Choice choice1;
Checkbox ch1,ch2,ch3,ch4,ch5;
double num=0,money;
CheckboxGroup cbg,cbg1;
TextField txtamt,txtbal;

public void init() {
Label lblhead = new Label();
cbg = new CheckboxGroup();
ch1 = new Checkbox("COLA", cbg, false);
ch2 = new Checkbox("ORANGE", cbg, false);
ch3 = new Checkbox("LIME", cbg, false);
Button    b1 = new Button();
Button    b2 = new Button();
Button    b3 = new Button();
Button    b4 = new Button();
Button    b5 = new Button();
Button    b6 = new Button();
Button    b7 = new Button();
Choice    choice1 = new Choice();
choice1.add("10 oz");
choice1.add("16 oz");

Label    lblsize = new Label();
Label    lbltype = new Label();
cbg1 = new CheckboxGroup();
ch4 = new  Checkbox("Regular", cbg, false);
ch5 = new Checkbox("Diet", cbg, false);
Label    lblamt = new Label();
TextField    txtamt = new TextField();
Button    btnbal = new Button();
TextField    txtbal = new TextField();
Button    btnref = new Button();
Label    lblfoot = new Label();

setBackground(new Color(255, 153, 153));
setLayout(null);

lblhead.setAlignment(Label.CENTER);
lblhead.setFont(new Font("Calibri", 1, 18));
lblhead.setText("Soda Vending Machine");
add(lblhead);
lblhead.setBounds(80, 30, 230, 30);

add(ch1);
ch1.setBounds(60, 70, 58, 20);

add(ch2);
ch2.setBounds(60, 100, 77, 20);

add(ch3);
ch3.setBounds(60, 130, 53, 20);

b1.setBackground(new Color(0, 153, 153));
b1.setLabel("RM 00.10"); ...
peter_budo commented: MIssing code tags, bad for you... -2

Does java has toString function?

eg : txtamt.setText(toString(num));

But it doesn't work. Plz give me the right method.

OK. It's work. Thanks alot.
Thank u.

This is my code.

import java.awt.*;
import java.awt.event.*;
import java.applet.*;

public class soda extends Applet implements ActionListener, ItemListener {

Button b1,b2,b3,b4,b5,b6,b7;
Choice choice1;
Checkbox ch1,ch2,ch3,ch4,ch5;
double num=0,money;
CheckboxGroup cbg;

public void init() {
Label lblhead = new Label();
cbg = new CheckboxGroup();
Checkbox    ch1 = new Checkbox("COLA", cbg, false);
Checkbox    ch2 = new Checkbox("ORANGE", cbg, false);
Checkbox    ch3 = new Checkbox("LIME", cbg, false);
Button    b1 = new Button();
Button    b2 = new Button();
Button    b3 = new Button();
Button    b4 = new Button();
Button    b5 = new Button();
Button    b6 = new Button();
Button    b7 = new Button();
choice1.add("10 oz");
choice1.add("16 oz");
Choice    choice1 = new Choice();
Label    lblsize = new Label();
Label    lbltype = new Label();
Checkbox    ch4 = new  Checkbox();
Checkbox    ch5 = new Checkbox();
Label    lblamt = new Label();
TextField    txtamt = new TextField();
Button    btnbal = new Button();
TextField    txtbal = new TextField();
Button    btnref = new Button();
Label    lblfoot = new Label();

setBackground(new Color(255, 153, 153));
setLayout(null);

lblhead.setAlignment(Label.CENTER);
lblhead.setFont(new Font("Calibri", 1, 18)); // NOI18N
lblhead.setText("Soda Vending Machine");
add(lblhead);
lblhead.setBounds(80, 30, 230, 30);

add(ch1);
ch1.setBounds(60, 70, 58, 20);

add(ch2);
ch2.setBounds(60, 100, 77, 20);

add(ch3);
ch3.setBounds(60, 130, 53, 20);

b1.setBackground(new Color(0, 153, 153));
b1.setLabel("RM 00.10");
add(b1);
b1.setBounds(320, 60, 70, 24);

b2.setBackground(new Color(0, 153, 153));
b2.setLabel("RM 00.20");
add(b2);
b2.setBounds(320, 100, 68, 24);

b3.setBackground(new Color(0, 153, 153));
b3.setLabel("RM 00.50");
add(b3);
b3.setBounds(320, 140, 68, 24);

b4.setBackground(new Color(0, 153, 153));
b4.setLabel("RM 1.00");
add(b4);
b4.setBounds(320, 180, 70, 24);

b5.setBackground(new Color(0, 153, 153));
b5.setLabel("RM 2.00");
add(b5);
b5.setBounds(320, 220, 70, 24);

b6.setBackground(new Color(0, 153, ...

I created a java Applet. It has an error. The error is applet not initialized.
I need urgent help for this error. I created the interface using netbeings & coppied the code to the Jcreater. :(

:) Thanks a lot for helping me !!!!!!!!!!!!!!!!!!!!

How to use ActionListener and ItemListener together in one java program??