public boolean action(Event evt, Object arg) { if (evt.target instanceof Button) { String selectedButton = arg.toString(); if (selectedButton == "Play") { String x[] = {"A", "B"}; Game.main(x); } if (selectedButton == "Map Editor") { String x[] = {"A", "B"}; MapEditor.main(x); } if (selectedButton == "Exit DuskFire") { System.out.println("Exiting Game"); if (JOptionPane.showConfirmDialog( null, "Are you sure you want to exit DuskFire", "Exiting DuskFire", JOptionPane.YES_NO_OPTION) == 0) { dispose(); } } } return true; }