Changing Color of a Java graphic object
问题 I'm trying to flash a Java graphic object by changing the color and calling the repaint() method. The color is only updating with the final change color call. Here is my code: public void start() { try { Color origColor = node.getColor(); for (int i=0; i<noOfFlashes; i++) { Manager.gui.getDrawGraph().changeNodeColor(node, Color.WHITE); Thread.sleep(500); Manager.gui.getDrawGraph().changeNodeColor(node, origColor); Thread.sleep(500); } Manager.gui.getDrawGraph().changeNodeColor(node, Graph