Focus « Text Input « Java Swing Q&A





1. How to select all text in a JFormattedTextField when it gets focus?    stackoverflow.com

I have a small Java desktop app that uses Swing. There is a data entry dialog with some input fields of different types (JTextField, JComboBox, JSpinner, JFormattedTextField). When I activate the ...

2. How can I give this password field focus?    stackoverflow.com

This may seem trivial, but I can't figure out how to give the password box in this dialog focus.

import javax.swing.JOptionPane;
import javax.swing.JPasswordField;

public class PasswordBox {
    @SuppressWarnings("unused")
    ...

3. Swing: why does JFormattedTextField adds "," on focus lost    stackoverflow.com

the question is in the title. I'm displaying an int number in my textfield but it keeps adding a "," when I exit the field... any ideas why? for the code lovers : the ...

4. FocusEvent doesn't get the last value of JFormattedTextField, How I can get it?    stackoverflow.com

I have two JFormattedTextField objects on my JFrame object. I want a basic Math (addition) by the values of these JFormattedTextField objects. I want it happen when focus lost either the ...

5. jFormattedTextField's Formatter.setCommitsOnValidEdit(true) doesn't work at first focus    stackoverflow.com

I have a jFormattedTextField and I set setCommitsOnValidEdit to true then I added an event listener to "property change" on "value" property. At first focus of that jFormattedTextField it doesn't call event ...

6. JPasswordField focus issue    stackoverflow.com

I wrote a very simple logon JPanel following the demo in http://download.oracle.com/javase/tutorial/uiswing/components/passwordfield.html it has three components,

  1. JTextField to get username
  2. JPasswordField to get password
  3. JButton to logon
then the JPanel is shown in ...

7. how to set focus to password field in swings    coderanch.com

Hi This is my code..... I need to set the cursor for oldpassword field while opening this window. How can I get it? public class ChangePasswordDialog extends EMSDialog { /** * User Login Name */ final Category log = Category.getInstance(ChangePasswordDialog.class); private String userName = null; private JLabel userNameLabel = null; private JLabel oldPasswordLabel = null; private JLabel newPasswordLabel = null; private ...





10. JFormattedTextField focus navigation control    forums.oracle.com