Skip to content
Permalink
Browse files

player names

  • Loading branch information
afortuna2016
afortuna2016 committed Apr 22, 2017
1 parent 58fdd3d commit 558489daecff36d1640bc5d742ba41fbff392210
Showing with 102 additions and 6 deletions.
  1. BIN bin/controller/Cashflow.class
  2. +0 −2 src/controller/Cashflow.java
  3. +102 −4 src/view/MainMenu.java
BIN +0 Bytes (100%) bin/controller/Cashflow.class
Binary file not shown.
@@ -8,8 +8,6 @@

public class Cashflow
{


private GameBoard _board;
public Player[] players;
//private CardStack[] _cards;
@@ -77,13 +77,36 @@ public static void main (String[] args)
panel10.setLocation(175, 120);
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 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");
@@ -93,6 +116,11 @@ public static void main (String[] args)
JButton four = new JButton ("Four");
JButton five = new JButton ("Five");
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.setForeground(Color.MAGENTA);
@@ -118,6 +146,16 @@ public static void main (String[] args)
six.setPreferredSize(new Dimension(80,40));
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;
try {
img = ImageIO.read(new File("gameboard.png"));
@@ -138,6 +176,13 @@ public static void main (String[] args)
panel6.add(four);
panel7.add(five);
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(panel2);
@@ -170,9 +215,21 @@ public void actionPerformed(ActionEvent e) {

four.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
frame.dispose();
Cashflow.go();
frame.setVisible(false);
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);
}
});

@@ -181,6 +238,47 @@ public void actionPerformed(ActionEvent e) {
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);
}
});


}

}

0 comments on commit 558489d

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