Prevent Java from repainting the content of a JPanel while updating
问题 I have a JPanel which contains a lot of child components. While updating\adding new components to the parent JPanel I'd like to prevent it from repainting, how can this achieved? 回答1: Try RepaintManager.currentManager(component).markCompletelyClean(component). It will prevent the component from repainting. You might need to do this after each time you add new components. 回答2: setVisible(false) update setVisible(true) 回答3: you could try by using setIgnoreRepaint(boolean value) but it's a