Commit 6d1eb0d8 authored by 9831111's avatar 9831111 🙂

Add OfflineMode Action Listener.

parent c52a5fe0
...@@ -102,6 +102,44 @@ public class MainFrame extends JFrame { ...@@ -102,6 +102,44 @@ public class MainFrame extends JFrame {
} }
} }
class OfflineModeAction implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
JFrame dialogFrame = new JFrame("Change settings ");
dialogFrame.setResizable(false);
dialogFrame.setLayout(new FlowLayout());
dialogFrame.setBounds(700,450,300,85);
JLabel settingLabel = new JLabel("Do you want to play with current setting ?");
dialogFrame.add(settingLabel);
JButton yesButton = new JButton("Yes");
yesButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
dialogFrame.dispose();
new OfflineModeFrame("Choose Your Game Mode : ");
//new Game starts here...
}
});
JButton noButton = new JButton("No");
noButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
dialogFrame.dispose();
new SettingFrame();
}
});
dialogFrame.add(yesButton);
dialogFrame.add(noButton);
dialogFrame.setVisible(true);
}
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment