From ce5d24e65359261714a405e84118c29ad0080d67 Mon Sep 17 00:00:00 2001 From: Zocker1999NET Date: Sun, 3 Jul 2016 21:34:51 +0200 Subject: [PATCH] Debug Spielername Abfrage --- Colours.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Colours.java b/Colours.java index d635576..0b26752 100644 --- a/Colours.java +++ b/Colours.java @@ -102,7 +102,7 @@ public class Colours extends World implements ButtonEvent { color[x] = sw; pn[x]=getName(x,"Schwarz"); - if(pn[x] != null) { + if(pn[x] != "") { x+=1; possw = false; } @@ -111,7 +111,7 @@ public class Colours extends World implements ButtonEvent { color[x] = bl; pn[x]=getName(x,"Blau"); - if(pn[x] != null) { + if(pn[x] != "") { x+=1; posbl = false; } @@ -120,7 +120,7 @@ public class Colours extends World implements ButtonEvent { color[x] = gr; pn[x]=getName(x,"Grün"); - if(pn[x] != null) { + if(pn[x] != "") { x+=1; posgr = false; } @@ -129,7 +129,7 @@ public class Colours extends World implements ButtonEvent { color[x] = rt; pn[x]=getName(x,"Rot"); - if(pn[x] != null) { + if(pn[x] != "") { x+=1; posrt = false; } @@ -138,7 +138,7 @@ public class Colours extends World implements ButtonEvent { color [x] = gb; pn[x]=getName(x,"Gelb"); - if(pn[x] != null) { + if(pn[x] != "") { x+=1; posgb = false; } @@ -147,7 +147,7 @@ public class Colours extends World implements ButtonEvent { color [x] = li; pn[x]=getName(x,"Lila"); - if(pn[x] != null) { + if(pn[x] != "") { x+=1; posli = false; } @@ -217,8 +217,8 @@ public class Colours extends World implements ButtonEvent private String getName(int id, String col) { String name = JOptionPane.showInputDialog(null, "Wie soll Spieler Nr. "+id+" mit der Farbe "+col+" heißen?"); - if(name == "") { - name = null; + if(name == null) { + name = ""; } return name; }