Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Text rendering artifacts



On Sep 4, 2008, at 5:36 AM, Ken Orr wrote:

Does anyone know why resizing a window can cause weird text drawing artifacts (see below)? Running with - Dapple.awt.graphics.UseQuartz=true doesn't seem to help much.

Good text:
<good_text.png>
Bad text (after tiny resize):
<bad_text.png>

Here's some sample code to reproduce the problem:

public class TextAntialiasingTest {

public static void main(String[] args) {
JLabel button = new JLabel("A Button With Some Text", SwingConstants.CENTER);


       JFrame frame = new JFrame();
       frame.add(button);
       frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
       frame.setSize(200,100);
       frame.setLocationRelativeTo(null);
       frame.setVisible(true);
   }

}

JLabels (like most Aqua controls) are setOpaque(false) by default. If you put the label on a panel (which is setOpaque(true)), it's will be asked to paint it's background color before the label paints again.


Hope this help explains what's going on,
Mike Swingler
Java Runtime Engineer
Apple Inc.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden
References: 
 >Text rendering artifacts (From: Ken Orr <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.