Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
can pick players now
  • Loading branch information
afortuna2016 committed Apr 22, 2017
1 parent 3f51761 commit 58fdd3d
Showing 1 changed file with 70 additions and 10 deletions.
80 changes: 70 additions & 10 deletions src/view/MainMenu.java
Expand Up @@ -25,58 +25,98 @@ public class MainMenu
int y = (int) ((dimension.getHeight() - frame.getHeight()) / 2) -100; int y = (int) ((dimension.getHeight() - frame.getHeight()) / 2) -100;
frame.setLocation(x, y); frame.setLocation(x, y);


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


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


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


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


JPanel panel5 = new JPanel(); final JPanel panel5 = new JPanel();
panel5.setSize(140, 45); panel5.setSize(140, 45);
panel5.setLocation(255, 330); panel5.setLocation(255, 330);
panel5.setOpaque(false); 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 newGame = new JButton("New Game");
JButton savedGame = new JButton("Saved Game"); JButton savedGame = new JButton("Saved Game");
JButton rules = new JButton("Rules"); JButton rules = new JButton("Rules");
JButton settings = new JButton("Settings"); JButton settings = new JButton("Settings");
JButton exit = new JButton("Exit"); 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.setPreferredSize(new Dimension(140,40));
newGame.setForeground(Color.MAGENTA); newGame.setForeground(Color.MAGENTA);


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



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



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



exit.setPreferredSize(new Dimension(100,40)); exit.setPreferredSize(new Dimension(100,40));
exit.setForeground(Color.MAGENTA); 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; BufferedImage img = null;
try { try {
Expand All @@ -95,6 +135,9 @@ public class MainMenu
panel3.add(rules); panel3.add(rules);
panel4.add(settings); panel4.add(settings);
panel5.add(exit); panel5.add(exit);
panel6.add(four);
panel7.add(five);
panel8.add(six);


frame.add(panel1); frame.add(panel1);
frame.add(panel2); frame.add(panel2);
Expand All @@ -105,8 +148,16 @@ public class MainMenu


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

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


Expand All @@ -117,11 +168,20 @@ public class MainMenu
} }
}); });


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

}
});

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

} }


0 comments on commit 58fdd3d

Please sign in to comment.