hi,
Thanks for the reply. I implemented the logic , but it doesnot seem to work.
I am pasting the code below for ur perusal.
Thank you once again.
regards,
ganesh.
public class HelloWorld2 extends JApplet implements ActionListener {
Frame a = new Frame("Deembed");
String data_a[] = { "a" , "b" , "c" };
String data_b[] = { "d" , "e" , "f" };
String data_c[] = { "x" , "y", "z" };
String data[] = { "trans" , "ind" , "cap" };
JComboBox CB2 = new JComboBox(data_a);
public void init()
{
JComboBox CB1 = new JComboBox(data);
this.getContentPane().add(CB1);
this.getContentPane().add(CB2);
this.getContentPane().setLayout(new FlowLayout());
}
public void actionPerformed(ActionEvent e) {
JComboBox cb = (JComboBox)e.getSource();
String data = (String)cb.getSelectedItem();
//process : Add data to CB2
if(data == "ind") {
CB2.removeAllItems();
CB2.addItem(data_b);
}
else if (data== "cap"){
CB2.removeAllItems();
CB2.addItem(data_c);
}
}
}