1/11
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
JTextField
The object of a ______ class is a text component that allows the editing of a single line text.
public class JTextField extends JTextComponent implements SwingConstantsJTextField class declaration
JTextField()
JTextField(String text)
JTextField(String text, int columns)
JTextField(int columns)
Commonly used Constructors in JTextField:
JTextField()
Creates a new TextField
JTextField(String text)
Creates a new TextField initialized with the specified text.
JTextField(String text, int columns)
Creates a new TextField initialized with the specified text and columns.
JTextField(int columns)
Creates a new empty TextField with the specified number of columns.
void addActionListener(ActionListener l)
Action getAction()
void setFont(Font f)
void removeActionListener(ActionListener l)
Commonly used Methods in JTextField:
void addActionListener(ActionListener l)
It is used to add the specified action listener to receive action events from this textfield.
Action getAction()
It returns the currently set Action for this ActionEvent source, or null if no Action is set.
void setFont(Font f)
It is used to set the current font.
void removeActionListener(ActionListener l)
It is used to remove the specified action listener so that it no longer receives action events from this textfield.