For a drag and drop operation, on mousePressed on a JButton, I want to
draw a "screenshot" of the JButton.
Anybody knows how?
Andrew Thompson - 30 May 2005 10:27 GMT
> ..I want to draw a "screenshot" of the JButton.
<http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Robot.html#createScreenCapture(
java.awt.Rectangle)>
HTH

Signature
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
Andrey Kuznetsov - 30 May 2005 19:27 GMT
> For a drag and drop operation, on mousePressed on a JButton, I want to
> draw a "screenshot" of the JButton.
>
> Anybody knows how?
As Andrew mentioned, you can use Robot.
Another way is to create BufferedImage or (better) VolatileImage
and paint component into image's Graphics.
I used this technic to paint dock preview.
See docking demo at http://jgui.imagero.com/classes/gtest.jnlp

Signature
Andrey Kuznetsov
http://uio.imagero.com Unified I/O for Java
http://reader.imagero.com Java image reader
http://jgui.imagero.com Java GUI components and utilities