Real'sHowTo AddThis Feed Button
Custom Search

Right justified JTextfield contentTag(s): Swing


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);
    }
}

blog comments powered by Disqus


If you find this article useful, consider making a small donation
to show your support for this Web site and its content.

Written and compiled by Réal Gagnon ©1998-2013
[ home ]