1 package micropolisj.gui;
3 import java.awt.BorderLayout;
4 import java.awt.FlowLayout;
5 import java.awt.event.ActionEvent;
6 import java.awt.event.ActionListener;
8 import javax.swing.JButton;
9 import javax.swing.JFrame;
10 import javax.swing.JLabel;
11 import javax.swing.JPanel;
13 import micropolisj.network.ServerMicropolis;
20 this.mainWindow = mainWindow;
22 setBounds(200, 200, 600, 600);
24 setLayout(
new BorderLayout());
26 JLabel endMessageLabel =
new JLabel(
"big win!");
27 add(endMessageLabel, BorderLayout.CENTER);
29 JPanel menu =
new JPanel();
30 menu.setLayout(
new FlowLayout(FlowLayout.CENTER));
32 JButton newGameButton =
new JButton(
"new game");
33 newGameButton.addActionListener(
new ActionListener(){
34 public void actionPerformed(ActionEvent e){
38 menu.add(newGameButton);
40 JButton joinGameButton =
new JButton(
"join game");
41 joinGameButton.addActionListener(
new ActionListener(){
42 public void actionPerformed(ActionEvent e){
46 menu.add(joinGameButton);
48 JButton loadGameButton =
new JButton(
"load game");
49 loadGameButton.addActionListener(
new ActionListener(){
50 public void actionPerformed(ActionEvent e){
54 menu.add(loadGameButton);
56 JButton createServerButton =
new JButton(
"create server");
57 createServerButton.addActionListener(
new ActionListener(){
58 public void actionPerformed(ActionEvent e){
62 menu.add(createServerButton);
64 JButton continueGameButton =
new JButton(
"continue");
65 continueGameButton.addActionListener(
new ActionListener(){
66 public void actionPerformed(ActionEvent e){
70 menu.add(continueGameButton);
72 add(menu, BorderLayout.SOUTH);
77 void closeMainWindow(){
78 mainWindow.closeWindow();
79 mainWindow.makeClean();
94 this.setVisible(
false);
95 win.setVisible(
false);
103 this.setVisible(
false);
105 win.setVisible(
false);
107 win.setVisible(
true);
114 this.setVisible(
false);
116 win.setVisible(
false);
118 win.setVisible(
true);
127 this.setVisible(
false);