Right justified JTextfield content

From CodeCodex

Implementations[edit]

Java[edit]

import javax.swing. *;
import java.awt.*;

public class Test extends JApplet {
  JTextField textfield;
  public void init() {
    getContentPane().setLayout(new FlowLayout());
    textfield = new JTextField(10);
    // Right-justify the text
    textfield.setHorizontalAlignment(JTextField.RIGHT);
    getContentPane().add(textfield);
    }
}