> I'd be very interested in a workaround.

There's probably several things that will work, but
something as simple as this does the trick for me, and
will be fairly cheap.

                // if this line is removed, everything is OK
                graphics.setComposite(AlphaComposite.getInstance(
                                AlphaComposite.SRC_OVER, 0.6f));
                Font font = graphics.getFont();
                font = font.deriveFont(font.getStyle(), font.getSize2D());
                graphics.setFont(font);
                graphics.drawString("test", 10, 80);

it works because even though the font is the same as before,
the implementation treats it as simpler to simply set the new
font (since its not == the old one), and re-validate.
Since you need to revalidate anyway here, nothing is lost there.

-phil

[EMAIL PROTECTED] wrote:
Its probable that there's a workaround of setting
some other hint
at the same time that will tickle the re-validation.

I'd be very interested in a workaround. I was thinking about rendering the 
second text into a temporary image. Should work (if that would be the first 
text rendered there), but i'm worried about the performance hit - creating an 
image every time i need to paint the text of a button / toggle button / radio 
button / checkbox / ...

Thanks
Kirill
[Message sent by forum member 'kirillcool' (kirillcool)]

http://forums.java.net/jive/thread.jspa?messageID=225089

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to