How to pause/delay, a specific part of my code
问题 I have a paintComponent method, inside a class.It makes a grid of 10*10. And I want to lower the frame rate, so that every time the function colors a rectangle in the grid, I can see the progression public void paint(Graphics g1) { super.paint(g1); Graphics2D g= (Graphics2D) g1; for(Object a: Maze_Generator.list) { Cell c =(Cell)a; if(c.top()) g.drawLine(c.x(), c.y(), c.x()+c.length(), c.y()); if(c.bottom()) g.drawLine(c.x(), c.y()+c.length(),c.x()+c.length(),c.y()+c.length()); if(c.left()) g