FileDocCategorySizeDatePackage
BackwardsJLabel.javaAPI DocExample1316Mon Jan 09 11:02:00 GMT 2006None

BackwardsJLabel

public class BackwardsJLabel extends JLabel

Fields Summary
Constructors Summary
public BackwardsJLabel()

 super(); 
public BackwardsJLabel(Icon image)

super (image);
public BackwardsJLabel(Icon image, int align)

super (image, align);
public BackwardsJLabel(String text)

 super (text);
public BackwardsJLabel(String text, Icon icon, int align)

        super (text, icon, align);
    
public BackwardsJLabel(String text, int align)

 super (text, align);
Methods Summary
public static voidmain(java.lang.String[] args)

        BackwardsJLabel field =
            new BackwardsJLabel ("Through the looking glass");
        JFrame frame = new JFrame("Backwards Text");
        frame.getContentPane().add (field);
        frame.pack();
        frame.setVisible(true);
    
public voidpaint(java.awt.Graphics g)

        if (g instanceof Graphics2D) {
            Graphics2D g2 = (Graphics2D) g;
            AffineTransform flipTrans = new AffineTransform();
            double widthD = (double) getWidth();
            flipTrans.setToTranslation (widthD, 0);
            flipTrans.scale (-1.0, 1);
            g2.transform (flipTrans);
            super.paint(g);
        } else {
            super.paint(g);
        }