Vista glass effect in JFrame
843806Mar 21 2009 — edited Mar 21 2009Hi,
I try to get the vista glass effect working in JFrame via calling DwmExtendFrameIntoClientArea over JNI
It basically works but the problem is, that the jrootpane draws an opaque rect over the client area.
So I hacked the jframe a little bit to set my own jrootpane
jf.setRootPane(new JRootPane() {
public void paint(Graphics g)
{
super.paint(g);
}
});
still isn't working. disabling double buffering:
RepaintManager.currentManager(jf).setDoubleBufferingEnabled(false);
works. I now get a wonderful glass background :)
but as soon as i add some other component, like an opaque JPanel to the contentpane, it draws a gray opaque rect over the entrie contentpane (even there where the added component isn't).
I traced it and it happens where the added component draws its background (windows size e.g: 300x300, component bounds: e.g. 20,20,50x50 -> [0,0,300x300] becomes gray and component gets it background color)
Graphics Debug output says that this happens on : D3DFillRect
So my question is: How do I avoid that this gray background iis drawn and it would be cool if it even works with double buffering.
My idea is, that it is maybe related to Sun2dGraphics->surfaceData->(WFramePeer)peer->eraseBackground which is set to false or Sun2dGraphics->surfaceData->(WFramePeer)peer->background which is set to this nice gray color.
Bye,
Thomas