title: How can I capture image of desktop screen in java?
body: <p>I want to take a snapshot of desktop screen in java.
  How can i do this.</p>
  
  <p>This is similar to pressing print screen and paste data in ms-paint,
  and then save file in .png or .jpg format.</p>