To get the transparency I'm setting a JPanel as a glass pane, where i set the background color and redefine the following method:
- Code: Select all
@Override
protected Graphics getComponentGraphics(Graphics g) {
g = super.getComponentGraphics(g);
Graphics2D g2d = (Graphics2D) g;
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.03f));
return g2d;
}
Can someone advice about any other way to achieve transparency using a glass pane in DockableFrame. I'm also having issues displaying the gif image in the glass pane but first thing first.
Thanks,
J