Hello Daniweb Members,
I am a beginner programmer and I have a problem,
I am doing a PAT (Practical Assessment Task) for my school and I have come accross a huge problem,
I'm trying to get a value from a selected combobox in Netbeans, (I am using the GUI builder), but I just don't know what is going on fullstop.
I would like to use the variable from the combobox to decide which of the following frames it shall go to.
This is my code, Please Help <3
______________________________________________________________________________________
private void CargoTypeActionPerformed(java.awt.event.ActionEvent evt) {
int value = 0;
JComboBox typeCargo = (JComboBox)evt.getSource();
String type = (String)typeCargo.getSelectedItem();
if("Children".equals(type))
{
value = 1;
} else if("Goods".equals(type))
{
value = 2;
}
}
private void NextActionPerformed(java.awt.event.ActionEvent evt) {
int
load == 1;
if(Children == load)
{
dispose();
new HowMany().setVisible(true);;
} else if(Goods != load)
{
dispose();
new HowMuch().setVisible(true);;
}
}