offscreen JFrame snapshot - missing window decorations



Question and then some explanation.
Q: is there a way to get a non-visible JFrame to render to an offscreen buffer (ie BufferedImage) in such a way that the title bar is also drawn? By 'title bar' I mean the stuff the window manager typically provides (title bar, min/max buttons, etc).


So let me explain what I can already do first:

Been playing around with getting image captures of swing JFrames without them actually being displayed on screen. By offscreen here I do not mean simply outside the boundries of the physical screen but actually not displayed on the screen at all.

That I can do, no problem. eg: (on a JFrame)
setSize
addNotify
validate
At that point I have a JFrame that is displayable but not visible. I override isShowing in my 'offscreen' JFrame to always return true so paint works in spite of not actually being visible. Fine, I can then use
img = frame.createImage
g = img.getGraphics
paint(g)
and I've got an offscreen BufferedImage with the JFrame rendered to it.


Now it's the JFrame itself that I'm calling createImage on (that's why I had to override isShowing). So in addition to the content, the image has blank space at the top where the title bar would normally be, presumably because the window environment just never got asked to draw that stuff.

I actually want to have that title bar drawn though. Any suggestions? Only option I can think of so far is to break into JNI and find some native call to request the title bar be drawn. I'd like to avoid that. Assuming it's even possible it's not portable.

Ideas?
.