GNU Classpath (0.95) | |
Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
Nested Class Summary | |
protected class |
|
Nested classes/interfaces inherited from class javax.swing.text.JTextComponent | |
JTextComponent.AccessibleJTextComponent , JTextComponent.KeyBinding |
Nested classes/interfaces inherited from class javax.swing.JComponent | |
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container | |
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component | |
Component.AccessibleAWTComponent , Component.BltBufferStrategy , Component.FlipBufferStrategy |
Field Summary | |
static String |
|
Fields inherited from class javax.swing.text.JTextComponent | |
DEFAULT_KEYMAP , FOCUS_ACCELERATOR_KEY |
Fields inherited from class javax.swing.JComponent | |
TOOL_TIP_TEXT_KEY , UNDEFINED_CONDITION , WHEN_ANCESTOR_OF_FOCUSED_COMPONENT , WHEN_FOCUSED , WHEN_IN_FOCUSED_WINDOW , accessibleContext , listenerList , ui |
Fields inherited from class java.awt.Component | |
BOTTOM_ALIGNMENT , CENTER_ALIGNMENT , LEFT_ALIGNMENT , RIGHT_ALIGNMENT , TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver | |
ABORT , ALLBITS , ERROR , FRAMEBITS , HEIGHT , PROPERTIES , SOMEBITS , WIDTH |
Fields inherited from interface javax.swing.SwingConstants | |
BOTTOM , CENTER , EAST , HORIZONTAL , LEADING , LEFT , NEXT , NORTH , NORTH_EAST , NORTH_WEST , PREVIOUS , RIGHT , SOUTH , SOUTH_EAST , SOUTH_WEST , TOP , TRAILING , VERTICAL , WEST |
Constructor Summary | |
| |
| |
| |
| |
|
Method Summary | |
void |
|
protected void |
|
protected PropertyChangeListener | |
protected Document |
|
protected void |
|
AccessibleContext |
|
Action | |
ActionListener[] |
|
Action[] |
|
protected int |
|
int |
|
int |
|
BoundedRangeModel |
|
Dimension |
|
int |
|
String |
|
boolean |
|
void | |
void |
|
void |
|
void | |
void |
|
void |
|
void |
|
void | |
void |
|
void |
|
Methods inherited from class java.lang.Object | |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
public static final String notifyAction
Name of the action that gets sent when the content of the text field gets accepted.
- Field Value:
- "notify-field-accept"
public JTextField(int columns)
Creates a new instance ofJTextField
.
- Parameters:
columns
- the number of columns
- Throws:
IllegalArgumentException
- if columns %lt; 0
public JTextField(String text)
Creates a new instance ofJTextField
.
- Parameters:
text
- the initial text
public JTextField(String text, int columns)
Creates a new instance ofJTextField
.
- Parameters:
text
- the initial textcolumns
- the number of columns
- Throws:
IllegalArgumentException
- if columns %lt; 0
public JTextField(Document doc, String text, int columns)
Creates a new instance ofJTextField
.
- Parameters:
doc
- the document to usetext
- the initial textcolumns
- the number of columns
- Throws:
IllegalArgumentException
- if columns %lt; 0
public void addActionListener(ActionListener listener)
Adds a new listener object to this text field.
- Parameters:
listener
- the listener to add
protected PropertyChangeListener createActionPropertyChangeListener(Action action)
- Since:
- 1.3
protected Document createDefaultModel()
Creates the default model for this text field. This implementation returns an instance ofPlainDocument
.
- Returns:
- a new instance of the default model
protected void fireActionPerformed()
Sends an action event to all registeredActionListener
objects.
public AccessibleContext getAccessibleContext()
Returns the accessible context associated with theJTextField
.
- Specified by:
- getAccessibleContext in interface Accessible
- Overrides:
- getAccessibleContext in interface JTextComponent
- Returns:
- the accessible context associated with the
JTextField
public ActionListener[] getActionListeners()
Returns all registeredActionListener
objects.
- Returns:
- an array of listeners
- Since:
- 1.4
public Action[] getActions()
Returns the set of Actions that are commands for the editor. This is the actions supported by this editor plus the actions of the UI (returned by JTextComponent.getActions()).
- Overrides:
- getActions in interface JTextComponent
protected int getColumnWidth()
Returns the column width, which is the width of the character m for the font in use.
- Returns:
- the width of the character m for the font in use.
public int getColumns()
Returns the number of columns of this text field.
- Returns:
- the number of columns
public int getHorizontalAlignment()
Returns the horizontal alignment, which is one of: JTextField.LEFT, JTextField.CENTER, JTextField.RIGHT, JTextField.LEADING, JTextField.TRAILING.
- Returns:
- the horizontal alignment
public BoundedRangeModel getHorizontalVisibility()
Returns the bounded range model that describes the horizontal visibility of the text field in the case when the text does not fit into the available space. The actual values of this model are managed by the look and feel implementation.
- Returns:
- the bounded range model that describes the horizontal visibility
public Dimension getPreferredSize()
Returns the preferred size. If there is a non-zero number of columns, this is the number of columns multiplied by the column width, otherwise it returns super.getPreferredSize().
- Overrides:
- getPreferredSize in interface JComponent
public int getScrollOffset()
Returns the scroll offset in pixels.
- Returns:
- the scroll offset
public String getUIClassID()
Returns the class ID for the UI.
- Overrides:
- getUIClassID in interface JTextComponent
- Returns:
- "TextFieldUI";
public boolean isValidateRoot()
Returnstrue
, unless this is embedded in aJViewport
in which case the viewport takes responsibility of validating.
- Overrides:
- isValidateRoot in interface JComponent
- Returns:
true
, unless this is embedded in aJViewport
in which case the viewport takes responsibility of validating
public void removeActionListener(ActionListener listener)
Removes a listener object from this text field.
- Parameters:
listener
- the listener to remove
public void scrollRectToVisible(Rectangle r)
CallsscrollRectToVisible
on the component's parent. Components which can service this call should override.
- Overrides:
- scrollRectToVisible in interface JComponent
- Parameters:
r
- The rectangle to make visible
public void setActionCommand(String command)
Sets the command string used in action events.
- Since:
- 1.3
public void setColumns(int columns)
Sets the number of columns and then invalidates the layout.
- Parameters:
columns
- the number of columns
- Throws:
IllegalArgumentException
- if columns <320
public void setDocument(Document doc)
Sets the document to be used for this JTextField. This sets the document propertyfilterNewlines
totrue
and then calls the super behaviour to setup a view and revalidate the text field.
- Overrides:
- setDocument in interface JTextComponent
- Parameters:
doc
- the document to set
public void setFont(Font newFont)
Sets the current font and revalidates so the font will take effect.
- Overrides:
- setFont in interface JComponent
public void setHorizontalAlignment(int newAlign)
Sets the horizontal alignment of the text. Calls invalidate and repaint and fires a property change event.
- Parameters:
newAlign
- must be one of: JTextField.LEFT, JTextField.CENTER, JTextField.RIGHT, JTextField.LEADING, JTextField.TRAILING.
- Throws:
IllegalArgumentException
- if newAlign is not one of the above.
public void setScrollOffset(int offset)
Sets the scroll offset in pixels.
- Parameters:
offset
- the scroll offset
GNU Classpath (0.95) |