Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
player names
  • Loading branch information
afortuna2016 committed Apr 22, 2017
1 parent 58fdd3d commit 558489d
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 6 deletions.
Binary file modified bin/controller/Cashflow.class
Binary file not shown.
2 changes: 0 additions & 2 deletions src/controller/Cashflow.java
Expand Up @@ -8,8 +8,6 @@ import model.*;


public class Cashflow public class Cashflow
{ {


private GameBoard _board; private GameBoard _board;
public Player[] players; public Player[] players;
//private CardStack[] _cards; //private CardStack[] _cards;
Expand Down
106 changes: 102 additions & 4 deletions src/view/MainMenu.java
Expand Up @@ -77,13 +77,36 @@ public class MainMenu
panel10.setLocation(175, 120); panel10.setLocation(175, 120);
panel10.setOpaque(false); panel10.setOpaque(false);


final JPanel panel11 = new JPanel();
panel11.setSize(300, 50);
panel11.setLocation(175, 125);
panel11.setOpaque(false);

final JPanel panel12 = new JPanel();
panel12.setSize(300, 50);
panel12.setLocation(175, 160);
panel12.setOpaque(false);

final JPanel panel13 = new JPanel();
panel13.setSize(300, 50);
panel13.setLocation(125, 260);
panel13.setOpaque(false);

final JPanel panel14 = new JPanel();
panel14.setSize(300, 50);
panel14.setLocation(250, 260);
panel14.setOpaque(false);

final JPanel panel15 = new JPanel();
panel15.setSize(300, 50);
panel15.setLocation(175, 295);
panel15.setOpaque(false);


JLabel choose = new JLabel("Choose"); JLabel choose = new JLabel("Choose");
JLabel players = new JLabel("number of players"); JLabel players = new JLabel("number of players");
choose.setFont(new Font("Verdana", 1, 16)); choose.setFont(new Font("Verdana", 1, 16));
players.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");
Expand All @@ -93,6 +116,11 @@ public class MainMenu
JButton four = new JButton ("Four"); JButton four = new JButton ("Four");
JButton five = new JButton ("Five"); JButton five = new JButton ("Five");
JButton six = new JButton ("Six"); JButton six = new JButton ("Six");
JTextField player1 = new JTextField("Player 1");
JTextField player2 = new JTextField("Player 2");
JTextField player3 = new JTextField("Player 3");
JTextField player4 = new JTextField("Player 4");
JButton start = new JButton("Start");


newGame.setPreferredSize(new Dimension(140,40)); newGame.setPreferredSize(new Dimension(140,40));
newGame.setForeground(Color.MAGENTA); newGame.setForeground(Color.MAGENTA);
Expand All @@ -118,6 +146,16 @@ public class MainMenu
six.setPreferredSize(new Dimension(80,40)); six.setPreferredSize(new Dimension(80,40));
six.setForeground(Color.MAGENTA); six.setForeground(Color.MAGENTA);


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

player1.setPreferredSize(new Dimension(125,40));
player2.setPreferredSize(new Dimension(125,40));
player3.setPreferredSize(new Dimension(125,40));
player4.setPreferredSize(new Dimension(125,40));



BufferedImage img = null; BufferedImage img = null;
try { try {
img = ImageIO.read(new File("gameboard.png")); img = ImageIO.read(new File("gameboard.png"));
Expand All @@ -138,6 +176,13 @@ public class MainMenu
panel6.add(four); panel6.add(four);
panel7.add(five); panel7.add(five);
panel8.add(six); panel8.add(six);
panel9.add(players);
panel10.add(choose);
panel11.add(player1);
panel12.add(player2);
panel13.add(player3);
panel14.add(player4);
panel15.add(start);


frame.add(panel1); frame.add(panel1);
frame.add(panel2); frame.add(panel2);
Expand Down Expand Up @@ -170,9 +215,21 @@ public class MainMenu


four.addActionListener(new ActionListener() { four.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
frame.dispose(); frame.setVisible(false);
Cashflow.go(); frame.remove(panel3);
frame.remove(panel4);
frame.remove(panel6);
frame.remove(panel7);
frame.remove(panel8);
frame.remove(panel9);
frame.remove(panel10);


frame.add(panel11);
frame.add(panel12);
frame.add(panel13);
frame.add(panel14);
frame.add(panel15);
frame.setVisible(true);
} }
}); });


Expand All @@ -181,6 +238,47 @@ public class MainMenu
System.exit(0); System.exit(0);
} }
}); });

player1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {


System.exit(0);
}
});

player2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {


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


System.exit(0);
}
});

player4.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {


System.exit(0);
}
});

start.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
frame.dispose();
Cashflow.go();
System.exit(0);
}
});


} }


} }
Expand Down

0 comments on commit 558489d

Please sign in to comment.