JTextField textField = new JTextField("Hello World"); textField.setCaretPosition(textField.getText().length());
JTextField textField = new JTextField("Hello World"); textField.setCaretPosition(0);The package library for javax.swing is Java Foundation Classes (JFC) which is part of Java Standard Edition (SE) library.