Re: Drawing a screenshot of a component
- From: "Andrey Kuznetsov" <spam0@xxxxxxxxxxxxxxxxxxx>
- Date: Mon, 30 May 2005 20:27:15 +0200
> 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
--
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
.
- References:
- Prev by Date: Underline in a JTextfield
- Next by Date: RTF Encodings
- Previous by thread: Re: Drawing a screenshot of a component
- Next by thread: report generation in java
- Index(es):