I am trying to use comboboxes in a ticket payment screen for train tickets. I have two combo boxes. One for picking a route and the other for picking a time. What i want is when you pick a route in the first combo box, different departure times are availble in the time combobox depending on your route choice. I am trying to use if statements but its not working.
[JAVA = CODE]
routesCmb = new JComboBox();
routesCmb.addIt em("Please pick a route");
routesCmb.addIt em(route);
routesCmb.addIt em(route2);
timesCmb = new JComboBox();
timesCmb.addIte m("Please pick a time");
if routesCmb.Selec tedItem(route);
{
timesCmb.addIte m("3.00")
times.addITem(" 5.00")
}
[/CODE]
[JAVA = CODE]
routesCmb = new JComboBox();
routesCmb.addIt em("Please pick a route");
routesCmb.addIt em(route);
routesCmb.addIt em(route2);
timesCmb = new JComboBox();
timesCmb.addIte m("Please pick a time");
if routesCmb.Selec tedItem(route);
{
timesCmb.addIte m("3.00")
times.addITem(" 5.00")
}
[/CODE]
Comment