thebarslider
Programmer
Dear All,
I have what sounds like a simple problem but i'm stuck. All i want to do is open a combo box pop so you can view the drop down menu when the dialog is opened. My code is as follows:
this.setVisible(true);
this.showPopupCombo();
Where this is the dialog (this section of code is run inside InitDialog. And the method to show the drop down is:
public void showPopupCombo() {
if (!thingCombo.isPopupVisible()) {
thingCombo.setVisible(true);
thingCombo.setPopupVisible(true);
thingCombo.showPopup();
}
}
This always produces the Exception:
java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location
I understand that this means the component is not visable on the screen, i think this is because i am producing the Dialog box from a listener call on a text field. Although wherever i call the showComboPopup method from i always get the same error.
Hopefully someone can point me in the right direction. Its always the small errors that seem to get me.....Arrggh!
Mark.
I have what sounds like a simple problem but i'm stuck. All i want to do is open a combo box pop so you can view the drop down menu when the dialog is opened. My code is as follows:
this.setVisible(true);
this.showPopupCombo();
Where this is the dialog (this section of code is run inside InitDialog. And the method to show the drop down is:
public void showPopupCombo() {
if (!thingCombo.isPopupVisible()) {
thingCombo.setVisible(true);
thingCombo.setPopupVisible(true);
thingCombo.showPopup();
}
}
This always produces the Exception:
java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location
I understand that this means the component is not visable on the screen, i think this is because i am producing the Dialog box from a listener call on a text field. Although wherever i call the showComboPopup method from i always get the same error.
Hopefully someone can point me in the right direction. Its always the small errors that seem to get me.....Arrggh!
Mark.