.setVisible(true) immediate repaint
In a short method, I hide a JFrame using setVisible(false). Then I take a screenshot and restore the JFrame with setVisible(true). After made visible again, the window is supposed to show a different picture than before (lets say a part of that screenshot taken). The problem is that after setVisible(true) is called, the window is flashed with the old content for a split second before paintComponent is called and the updated state is drawn. I could probably workaround this in an ugly way, but I wanted to know if there are better solutions. Thanks in advance for any help edit: While preparing an