Skip to content
Permalink
Browse files

can pick players now

  • Loading branch information
afortuna2016
afortuna2016 committed Apr 22, 2017
1 parent 3f51761 commit 58fdd3d8d7f6a824bce0183e3d5cb9cf0fab2b7b
Showing with 70 additions and 10 deletions.
  1. +70 −10 src/view/MainMenu.java
@@ -25,58 +25,98 @@ public static void main (String[] args)
int y = (int) ((dimension.getHeight() - frame.getHeight()) / 2) -100;
frame.setLocation(x, y);

JPanel panel1 = new JPanel();
final JPanel panel1 = new JPanel();
panel1.setSize(140, 45);
panel1.setLocation(255, 125);
panel1.setOpaque(false);
//Font font = new Font ("Times New Roman", Font.BOLD, 30);
//panel1.setFont(font);

JPanel panel2 = new JPanel();
final JPanel panel2 = new JPanel();
panel2.setSize(140, 45);
panel2.setLocation(255, 160);
panel2.setOpaque(false);

JPanel panel3 = new JPanel();
final JPanel panel3 = new JPanel();
panel3.setSize(140, 45);
panel3.setLocation(255, 260);
panel3.setOpaque(false);

JPanel panel4 = new JPanel();
final JPanel panel4 = new JPanel();
panel4.setSize(140, 45);
panel4.setLocation(255, 295);
panel4.setOpaque(false);

JPanel panel5 = new JPanel();
final JPanel panel5 = new JPanel();
panel5.setSize(140, 45);
panel5.setLocation(255, 330);
panel5.setOpaque(false);

final JPanel panel6 = new JPanel();
panel6.setSize(140, 45);
panel6.setLocation(180, 158);
panel6.setOpaque(false);

final JPanel panel7 = new JPanel();
panel7.setSize(140, 45);
panel7.setLocation(260, 158);
panel7.setOpaque(false);

final JPanel panel8 = new JPanel();
panel8.setSize(140, 45);
panel8.setLocation(340, 158);
panel8.setOpaque(false);

final JPanel panel9 = new JPanel();
panel9.setSize(300, 45);
panel9.setLocation(185, 140);
panel9.setOpaque(false);

final JPanel panel10 = new JPanel();
panel10.setSize(300, 45);
panel10.setLocation(175, 120);
panel10.setOpaque(false);


JLabel choose = new JLabel("Choose");
JLabel players = new JLabel("number of players");
choose.setFont(new Font("Verdana", 1, 16));
players.setFont(new Font("Verdana", 1, 16));
panel9.add(players);
panel10.add(choose);

JButton newGame = new JButton("New Game");
JButton savedGame = new JButton("Saved Game");
JButton rules = new JButton("Rules");
JButton settings = new JButton("Settings");
JButton exit = new JButton("Exit");
JButton four = new JButton ("Four");
JButton five = new JButton ("Five");
JButton six = new JButton ("Six");

newGame.setPreferredSize(new Dimension(140,40));
newGame.setForeground(Color.MAGENTA);

savedGame.setPreferredSize(new Dimension(130,40));
savedGame.setForeground(Color.MAGENTA);


rules.setPreferredSize(new Dimension(80,40));
rules.setForeground(Color.MAGENTA);


settings.setPreferredSize(new Dimension(120,40));
settings.setForeground(Color.MAGENTA);


exit.setPreferredSize(new Dimension(100,40));
exit.setForeground(Color.MAGENTA);

four.setPreferredSize(new Dimension(80,40));
four.setForeground(Color.MAGENTA);

five.setPreferredSize(new Dimension(80,40));
five.setForeground(Color.MAGENTA);

six.setPreferredSize(new Dimension(80,40));
six.setForeground(Color.MAGENTA);

BufferedImage img = null;
try {
@@ -95,6 +135,9 @@ public static void main (String[] args)
panel3.add(rules);
panel4.add(settings);
panel5.add(exit);
panel6.add(four);
panel7.add(five);
panel8.add(six);

frame.add(panel1);
frame.add(panel2);
@@ -105,8 +148,16 @@ public static void main (String[] args)

newGame.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
frame.dispose();
Cashflow.go();
frame.setVisible(false);
frame.remove(panel1);
frame.remove(panel2);

frame.add(panel6);
frame.add(panel7);
frame.add(panel8);
frame.add(panel9);
frame.add(panel10);
frame.setVisible(true);
}
});

@@ -117,11 +168,20 @@ public void actionPerformed(ActionEvent e) {
}
});

four.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
frame.dispose();
Cashflow.go();

}
});

exit.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.exit(0);
}
});
}

}

0 comments on commit 58fdd3d

Please sign in to comment.
You can’t perform that action at this time.