Skip to content
Snippets Groups Projects
Commit 239f9da3 authored by FARESSE Adam's avatar FARESSE Adam
Browse files

Update GameOfLifeGUI.java

parent cccc153c
No related branches found
No related tags found
No related merge requests found
...@@ -39,10 +39,14 @@ public class GameOfLifeGUI extends JFrame { ...@@ -39,10 +39,14 @@ public class GameOfLifeGUI extends JFrame {
for (int x = 0; x < numberOfColumns; x++) for (int x = 0; x < numberOfColumns; x++)
for (int y = 0; y < numberOfRows; y++){ for (int y = 0; y < numberOfRows; y++){
JLabel label = labelGrid[x][y]; JLabel label = labelGrid[x][y];
if(g.getCell(x,y).isAlive()) if(g.getCell(x,y).isAlive()) {
label.setForeground(Color.red); if ((g.getCell(x,y).getColor()).equals("Red")) {
else label.setForeground(Color.red); }
label.setForeground(Color.white); else {
label.setForeground(Color.blue);} }
else {
label.setForeground(Color.white);}
} }
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment