takeScreenshot
Takes a screenshot of a JDialog.
Takes a screenshot of a JFrame.
Takes a screenshot of the Swing component. This is only possible if the component has been given a size, see JComponent.getSize. Either manually or through a java.awt.LayoutManager.
If the size of the component cannot be determined, null
is returned.