Hello I have a simple issue that is not a compilation or runtime issue, but an aesthetic problem that I can't find a function for. Basically I've created a GUI window that visually represents a game board for my Reversi gameboard. I've implemented the GUI and the Reversi gameplay and it runs fine in the command window, and shows up the way I intend on the GUI window, the only issue is when I update my gameboard in the command window (where I initiate the move I wish to make), the GUI window does not repaint() and validate() unless I minimize then reopen the GUI window.
Here is some pseudocode so you can better understand:
while(gameRunning){
//create GUI window
...
//handle game-logic
//update GUI with new gameboard layout
}
and that "update GUI" code
public void updateBoardGUI(char[][] gameBoard){
removeAll();
gameBoardGUI = gameBoard; //reset info completely
repaint();
validate();
}
So just to reiterate, this all works fine. The only issue is that I have to minimize and reopen the GUI window for the board to actually "refresh". What built in function is there so it automatically refreshes? If something like this doesn't exist, would creating a "refresh" button within the GUI help? How could I got about this?
Thanks!