FileDocCategorySizeDatePackage
AntiAliasedPanel.javaAPI DocExample833Mon Jan 09 11:02:00 GMT 2006None

AntiAliasedPanel

public class AntiAliasedPanel extends JPanel

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

        RepaintManager.setCurrentManager(new FullRepaintManager());
        JPanel panel = new AntiAliasedPanel();
        JFrame frame = new JFrame("Hack 100: Anti-Aliased text");
        frame.getContentPane().add(panel);
        
        JLabel label = new JLabel("This is anti-aliased text");
        label.setFont(label.getFont().deriveFont(40f));
        panel.add(label);
        
        frame.pack();
        frame.setVisible(true);
    
public voidpaintChildren(java.awt.Graphics g)

        Graphics2D g2 = (Graphics2D)g;
        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
        super.paintChildren(g2);