Hey, I have a problem which I need to resolve for my project. I want to open a different GUI class based on the selection made from a combobox:
How can I do this in java ?
Furthermore, how can i call a method from a different class when a button is clicked ?
Cheers in advance ;)
Code:
public void actionPerformed(ActionEvent event) {
JComboBox comboBox = (JComboBox)event.getSource();
String selection = (String)comboBox.getSelectedItem();
if (selection == "Price Elasticity of Demand") {
runGUI
}
Furthermore, how can i call a method from a different class when a button is clicked ?
Cheers in advance ;)
Comment