Two reasons why AA text doesn't work
When I first ran my home-grown editor app under Mustang-b40, neither the textarea nor the line-number gutter was displaying AA text (although they work fine under Tiger with the "swing.aatext" property set). I finally figured out what the problems were, and thought I'd share what I learned.
All JComponents are supposed to use the drawString/drawChars methods of the new SwingUtilities2 class to paint text. Before painting the text, they check the JComponent (which is passed as one of their parameters) for a certain client property which contains info about what kind of AA to use (if any), plus other hints. If the JComponent parameter is null, or it doesn't have that client property, no AA is used.
The client property is supposed to be set automatically when the JComponent is created, assuming the L&F supports AA. This is done in the setUI method. But if your JComponent subclass doesn't have a UI delegate, that method never gets called, and you don't get AA. That was the problem with my gutter component. I first got it to work by having it extend JPanel instead of JComponent, but I didn't really want to do that. So I tried just calling setUI(null) in the constructor, and it worked!
My textarea uses a custom View class, which ultimately calls the drawTabbedText method in javax.swing.text.Utilities. Trouble is, there are two versions of that method now, and I was calling the wrong one. The one I needed to call takes the View as its first parameter. It uses that to get a reference to the textarea, then passes that along to the SwingUtilities2.drawString method. Because I was calling the wrong method, drawString was receiving a null JComponent reference, so I got no AA. Unfortunately, the "right" method is package-private--I had to copy it into my own source tree to use it. Does anybody know a good reason why that method can't be public?