In my code I have this:
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC, alpha));
I'm using this to make a few elements of geometry half-transparent (or whatever alpha so happens to be at the time). When I'm done with the transparency, however, I'd like to go back to normal opaque drawing. But I don't know how to undo the AlphaComposite changes I made.
I tried this:
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.CLEAR));
but that doesn't seem to work.
Any other suggestions?