We use cookies to collect and analyze information on site performance and usage,
to provide social media features and to enhance and customize content and advertisements.
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);
}
}