JTextField
public JTextField(String text,int columns)
Constructs a new TextField initialized with the specified text and columns. A default model is created. Parameters:
text - the text to be displayed, or null
columns - the number of columns to use to calculate the preferred width; if columns is set to zero, the preferred width will be whatever naturally results from the component implementation
public JTextField(String text,int columns)
Constructs a new TextField initialized with the specified text and columns. A default model is created. Parameters:
text - the text to be displayed, or null
columns - the number of columns to use to calculate the preferred width; if columns is set to zero, the preferred width will be whatever naturally results from the component implementation
1、设定指定的字符数量,当输入量超过了指定数量的时候,textfield不响应,新输入的字符不会出现在输入框