2-APL UPC project.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

now works addPLayer sorry

fdesan dab2df35 6aadb049

+15 -17
+15 -17
code/2apl_platform/environments/cardtable/Table.java
··· 9 9 10 10 public JLabel[][] PlayerCards = new JLabel[8][5]; 11 11 12 - private JPanel CardDisplayPane; 12 + private static JPanel CardDisplayPane; 13 13 private JLayeredPane TablePane; 14 14 private JSplitPane VerticalSplitPane; 15 15 private JScrollPane GameInfo; 16 16 private JSplitPane HorizontalSplitPlane; 17 17 private JTextArea Info; 18 18 19 - private ImageIcon CardBack = new ImageIcon("cards/b.gif"); 19 + private static ImageIcon CardBack = new ImageIcon("cards/b.gif"); 20 20 21 21 22 22 public Table( ){ ··· 98 98 } 99 99 100 100 101 - public JSplitPane getSplitPane() { 102 - return HorizontalSplitPlane; 103 - } 104 - 105 101 public void addPlayer(String name, int position, int score, int bid) { 106 102 JButton button; 107 103 GridBagConstraints c = new GridBagConstraints(); ··· 112 108 JButton P1NameTag = new JButton(name); 113 109 c.fill = GridBagConstraints.HORIZONTAL; 114 110 c.gridx = 0; 115 - c.gridy = 0; 111 + c.gridy = 2*position; 116 112 c.gridwidth = 4; 117 113 CardDisplayPane.add(P1NameTag, c); 118 114 ··· 120 116 JButton P1Score = new JButton("Score : "+ scoreInt.toString()); 121 117 c.fill = GridBagConstraints.HORIZONTAL; 122 118 c.gridx = 4; 123 - c.gridy = 0; 119 + c.gridy = 2*position; 124 120 c.gridwidth = 2; 125 121 CardDisplayPane.add(P1Score, c); 126 122 ··· 128 124 JButton P1Bid = new JButton("Bid : "+ bidInt.toString()); 129 125 c.fill = GridBagConstraints.HORIZONTAL; 130 126 c.gridx = 6; 131 - c.gridy = 0; 127 + c.gridy = 2*position; 132 128 c.gridwidth = 2; 133 129 CardDisplayPane.add(P1Bid, c); 134 130 ··· 137 133 P1C1.setPreferredSize(new Dimension(55,80)); 138 134 c1.fill = GridBagConstraints.HORIZONTAL; 139 135 c1.gridx = 0; 140 - c1.gridy = 1; 136 + c1.gridy = 1+2*position; 141 137 CardDisplayPane.add(P1C1, c1); 142 138 143 139 //2nd Card ··· 145 141 P1C2.setPreferredSize(new Dimension(55,80)); 146 142 c1.fill = GridBagConstraints.HORIZONTAL; 147 143 c1.gridx = 1; 148 - c1.gridy = 1; 144 + c1.gridy = 1+2*position; 149 145 CardDisplayPane.add(P1C2, c1); 150 146 151 147 //3rd Card ··· 153 149 P1C3.setPreferredSize(new Dimension(55,80)); 154 150 c1.fill = GridBagConstraints.HORIZONTAL; 155 151 c1.gridx = 2; 156 - c1.gridy = 1; 152 + c1.gridy = 1+2*position; 157 153 CardDisplayPane.add(P1C3, c1); 158 154 159 155 //4th Card ··· 161 157 P1C4.setPreferredSize(new Dimension(55,80)); 162 158 c1.fill = GridBagConstraints.HORIZONTAL; 163 159 c1.gridx = 3; 164 - c1.gridy = 1; 160 + c1.gridy = 1+2*position; 165 161 CardDisplayPane.add(P1C4, c1); 166 162 167 163 //5th Card ··· 169 165 P1C5.setPreferredSize(new Dimension(55,80)); 170 166 c1.fill = GridBagConstraints.HORIZONTAL; 171 167 c1.gridx = 4; 172 - c1.gridy = 1; 168 + c1.gridy = 1+2*position; 173 169 CardDisplayPane.add(P1C5, c1); 174 170 175 171 //6th Card ··· 177 173 P1C6.setPreferredSize(new Dimension(55,80)); 178 174 c1.fill = GridBagConstraints.HORIZONTAL; 179 175 c1.gridx = 5; 180 - c1.gridy = 1; 176 + c1.gridy = 1+2*position; 181 177 CardDisplayPane.add(P1C6, c1); 182 178 183 179 //7th Card ··· 185 181 P1C7.setPreferredSize(new Dimension(55,80)); 186 182 c1.fill = GridBagConstraints.HORIZONTAL; 187 183 c1.gridx = 6; 188 - c1.gridy = 1; 184 + c1.gridy = 1+2*position; 189 185 CardDisplayPane.add(P1C7, c1); 190 186 191 187 //8th Card ··· 193 189 P1C8.setPreferredSize(new Dimension(55,80)); 194 190 c1.fill = GridBagConstraints.HORIZONTAL; 195 191 c1.gridx = 7; 196 - c1.gridy = 1; 192 + c1.gridy = 1+2*position; 197 193 CardDisplayPane.add(P1C8, c1); 194 + 195 + setVisible(true); 198 196 } 199 197 200 198