Commit 3d9c0484 authored by 9831111's avatar 9831111 🙂

Add OnlineMode Action Listener.

parent 6d1eb0d8
...@@ -39,6 +39,7 @@ public class MainFrame extends JFrame { ...@@ -39,6 +39,7 @@ public class MainFrame extends JFrame {
add(mainPhoto, BorderLayout.NORTH); add(mainPhoto, BorderLayout.NORTH);
setVisible(true); setVisible(true);
} }
public void initButtons() { public void initButtons() {
offlineModeIcon = new ImageIcon("pictures/offline.png"); offlineModeIcon = new ImageIcon("pictures/offline.png");
...@@ -67,6 +68,7 @@ public class MainFrame extends JFrame { ...@@ -67,6 +68,7 @@ public class MainFrame extends JFrame {
items.add(settingButton); items.add(settingButton);
items.add(exitButton); items.add(exitButton);
} }
class ExitButtonAction implements ActionListener { class ExitButtonAction implements ActionListener {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
...@@ -74,12 +76,14 @@ public class MainFrame extends JFrame { ...@@ -74,12 +76,14 @@ public class MainFrame extends JFrame {
new LoginFrame(); new LoginFrame();
} }
} }
class SettingButtonAction implements ActionListener { class SettingButtonAction implements ActionListener {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
new SettingFrame(); new SettingFrame();
} }
} }
class MouseAction extends MouseAdapter { class MouseAction extends MouseAdapter {
@Override @Override
public void mouseEntered(MouseEvent e) { public void mouseEntered(MouseEvent e) {
...@@ -102,7 +106,8 @@ public class MainFrame extends JFrame { ...@@ -102,7 +106,8 @@ public class MainFrame extends JFrame {
} }
} }
class OfflineModeAction implements ActionListener{
class OfflineModeAction implements ActionListener {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
...@@ -110,7 +115,7 @@ public class MainFrame extends JFrame { ...@@ -110,7 +115,7 @@ public class MainFrame extends JFrame {
JFrame dialogFrame = new JFrame("Change settings "); JFrame dialogFrame = new JFrame("Change settings ");
dialogFrame.setResizable(false); dialogFrame.setResizable(false);
dialogFrame.setLayout(new FlowLayout()); dialogFrame.setLayout(new FlowLayout());
dialogFrame.setBounds(700,450,300,85); dialogFrame.setBounds(700, 450, 300, 85);
JLabel settingLabel = new JLabel("Do you want to play with current setting ?"); JLabel settingLabel = new JLabel("Do you want to play with current setting ?");
dialogFrame.add(settingLabel); dialogFrame.add(settingLabel);
...@@ -138,8 +143,16 @@ public class MainFrame extends JFrame { ...@@ -138,8 +143,16 @@ public class MainFrame extends JFrame {
dialogFrame.setVisible(true); dialogFrame.setVisible(true);
} }
} }
class OnlineModeAction implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {
new OnlineModeFrame();
}
}
} }
\ 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