C
Carla
Hi,
I have a JComboBox1 in JFrame1 and it has two options "Y/N". If the
option Y is selected, I want to open another JFrame2 and only after
submitting all the details, one should be able to get back to JFrame1.
It looks like I am not listening for the right events.
This is what I am doing currently.
=========================================================
private void bagCBoxActionPerformed(java.awt.event.ActionEvent evt)
{
if (bagCBox.getSelectedItem().toString() == "Y") {
new BaggageInfoInsertionGUI().setVisible(true);
}
}
=========================================================
public void initFormFields() {
bagCBox.addItem("Y");
bagCBox.addItem("N");
}
=======================================================
What is happening that even when I am adding these items into the
JComboBox1, it is opening up the JFrame2. And the worst, even if the
JFrame2 is opened up - every time I am selecting Y from the JComboBox1
- it is opening up another JFrame1 every time.
Please help.
I have a JComboBox1 in JFrame1 and it has two options "Y/N". If the
option Y is selected, I want to open another JFrame2 and only after
submitting all the details, one should be able to get back to JFrame1.
It looks like I am not listening for the right events.
This is what I am doing currently.
=========================================================
private void bagCBoxActionPerformed(java.awt.event.ActionEvent evt)
{
if (bagCBox.getSelectedItem().toString() == "Y") {
new BaggageInfoInsertionGUI().setVisible(true);
}
}
=========================================================
public void initFormFields() {
bagCBox.addItem("Y");
bagCBox.addItem("N");
}
=======================================================
What is happening that even when I am adding these items into the
JComboBox1, it is opening up the JFrame2. And the worst, even if the
JFrame2 is opened up - every time I am selecting Y from the JComboBox1
- it is opening up another JFrame1 every time.
Please help.