Snippet to capture monitor screen in Java