FileDocCategorySizeDatePackage
BackwardsJTextField.javaAPI DocExample1309Mon Jan 09 11:02:00 GMT 2006None

BackwardsJTextField

public class BackwardsJTextField extends JTextField

Fields Summary
Constructors Summary
public BackwardsJTextField()

 super(); 
public BackwardsJTextField(Document doc, String text, int columns)

        super (doc, text, columns); 
    
public BackwardsJTextField(int columns)

 super (columns); 
public BackwardsJTextField(String text)

 super (text);
public BackwardsJTextField(String text, int columns)

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

        BackwardsJTextField field =
            new BackwardsJTextField ("Through the looking glass", 50);
        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);
        }