Commit 89101bba authored by Tristan MAISONNEUVE's avatar Tristan MAISONNEUVE
Browse files

Fentre Co adjustements sur la création de bateau

parent cad96cfc
......@@ -80,6 +80,7 @@ public class FenetreConnexion extends JFrame {
chiffre++;
}
final Bouttons boutton = new Bouttons(new JButton(), lettre + String.valueOf(chiffre));
boutton.getButton().setBackground(Color.WHITE);
bouttons[o] = boutton;
o++;
......@@ -89,6 +90,7 @@ public class FenetreConnexion extends JFrame {
public void actionPerformed(ActionEvent e) {
if(co[0]==null){
co[0]=boutton.getString();
boutton.getButton().setBackground(Color.LIGHT_GRAY);
} else {
co[1] = boutton.getString();
CreationB c = new CreationB(co[0],co[1]);
......@@ -104,8 +106,18 @@ public class FenetreConnexion extends JFrame {
}
} else {
JOptionPane.showMessageDialog(null, "Flotte déja pleine");
for(int i=0;i<100;i++){
if(bouttons[i].getString().equals(co[0])){
bouttons[i].getButton().setBackground(Color.WHITE);
}
}
}
} else {
for(int i=0;i<100;i++){
if(bouttons[i].getString().equals(co[0])){
bouttons[i].getButton().setBackground(Color.WHITE);
}
}
} {
co[0]=null;
}
} catch (CoordsBadShipException coordsBadShipException) {coordsBadShipException.printStackTrace();} catch (BadCoordException badCoordException) {badCoordException.printStackTrace();}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment