private void testScreenCapture() { ImageComponent activeIC = ImageComponents.getActiveIC(); testScreenCapture(true); testScreenCapture(false); try { SwingUtilities.invokeAndWait( () -> { ImageComponents.setActiveImageComponent(activeIC, true); }); } catch (InterruptedException | InvocationTargetException e) { e.printStackTrace(); } }