java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.text.JTextComponent
javax.swing.JTextField
public class JTextField extends JTextComponent
| Constructor Summary |
|---|
JTextField()
Constructs a new TextField. |
JTextField(int columns)
Constructs a new empty TextField with the specified
number of columns. |
JTextField(String text)
Constructs a new TextField initialized with the
specified text. |
JTextField(String text,
int columns)
Constructs a new TextField initialized with the
specified text and columns. |
| Method Summary | |
|---|---|
int |
getColumns()
Returns the number of columns in this TextField. |
int |
getHorizontalAlignment()
Returns the horizontal alignment of the text. |
void |
setColumns(int columns)
Sets the number of columns in this TextField,
and then invalidate the layout. |
void |
setFont(Font f)
Sets the current font. |
void |
setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the text. |