confirmButton = new JButton(riverFrameBackend.confirmText());
confirmButton.setEnabled(true);
confirmButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent action) {
if(ferryRadioButton.isSelected()) {
gameControl.setNextEvent(new Event(riverFrameBackend.getRiver().takeFerry(), gameControl));
}
else if(caulkRadioButton.isSelected()){
gameControl.setNextEvent(new Event(riverFrameBackend.getRiver().caulk(), gameControl));
}
else if(fordRadioButton.isSelected()){
gameControl.setNextEvent(new Event(riverFrameBackend.getRiver().ford(), gameControl));
}
else{
gameControl.setNextEvent(new Event(riverFrameBackend.errorText(), gameControl));
}
EventFrameBackend eventFrameBackend = new EventFrameBackend(gameControl.getNextEvent());
myCD.add(new EventFrame(gameControl, eventFrameBackend, myCD), "newEvent");
gameControl.setNextEvent(new Event());
CardLayout cd = (CardLayout) myCD.getLayout();
cd.last(myCD);
}
});
confirmButton.setBounds(138, 252, 89, 23);