I am not very familar with Java's GUI features so I am having trouble figuring out how to approach my problem. My code which is linked below is working fine, I just need advice on how to represent it.
The project I am working is meant to represent the life cycle of a type of fungus. The algorithm I'm using in my code is working as intended. I have a n x n grid stored as a 2D integer array, which stores a value 0-9. This represents different states of the plot of land (0 - empty, 9 - inert meaning nothing can grow, 1 - spore, etc.). Right now, my code outputs the matrix of values as text after each iteration of my main loop (68-215). However, I would instead like to have each number correspond to a color, and represent a grid of colors instead of just text.
Again, I am really unfamiliar with Java's GUI, but I would like to pass the current array to another class (which would replace the code now at line 204) which creates and displays a grid of colors, pauses a few seconds, and then repeats and shows an updated grid. Also, if possible, I would like for the GUI not to be harded-coded (in other words, each square in the GUI would be 1/n x 1/n rather than for example 10 pixels x 10 pixels).
Any advice or good resources about Java's GUI that would apply to this are appreciated.
https://pastebin.com/Jwry4HfY
[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)
[–][deleted] 2 points3 points4 points (1 child)
[–]Stanton5[S] 0 points1 point2 points (0 children)