I have an application that displays a main menu. Then after clicking one of the buttons on the main menu, it should open a new window. The code for the new JFrame to be displayed after clicking on the button, is in an external class.
How can I get this new window to display once the button is clicked? Currently, the code I have doesn't respond to the button click. No errors are shown, but no new window is either.
//code in main class
public void actionPerformed(ActionEvent e)
Object source = e.getSource();
if (source == exitButton)
else if (source == calculatorButton)
prizeCalculator object1 = new prizeCalculator();
// Code snippet from external class that contains new window code
public class prizeCalculator
class prizeCalculatorFrame extends JFrame
JPanel panel = new prizeCalculatorPanel();