I've followed everything you've done for the GUI perfectly (aside from adding more options for the enemies), but when I build it I get the error that java ')' expected in place of -> in the button.addActionListener(1 -> { ....
I am not sure why this is happening, and dont know how to resolve this issue. Still pretty new at all of this so maybe I've just missed something, any help is greatly appreciated.
for reference this is exactly what I have down
button.addActionListener(1 -> {
foodName = foodNameTextField.getText(); //store inputted food name
lootBones = lootCheckBox.isSelected();
/*
our enemyComboBox was filled with strings but getselecteditem returns an object. This means we need to call
.tostring() on the object to get the selected string.
*/
enemyName = enemyComboBox.getSelectedItem().toString();
isRunning = true; // now our script will start looping our code.
frame.dispose(); //closes the GUI window
});