copy actual window to clipboard
I would like to create a screen shot of a set of diagrams. Currently I only can copy text, but no pictures :( . What I have in the moment (for test reasons with button):
Code:
JButton copy = new JButton("Copy");
copy.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
String selection = jt.getSelectedText();
StringSelection data = new StringSelection(selection);
clipboard.setContents(data, data);
}
Anyone has an idea, what I need to change to copy the current screen of the button to clipboard - Thanks