|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.text.JTextComponent
javax.swing.JTextField
com.myjavaworld.gui.MTextField
public class MTextField
An extension of javax.swing.MTextField
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JTextField |
---|
JTextField.AccessibleJTextField |
Nested classes/interfaces inherited from class javax.swing.text.JTextComponent |
---|
JTextComponent.AccessibleJTextComponent, JTextComponent.DropLocation, 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.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class javax.swing.JTextField |
---|
notifyAction |
Fields inherited from class javax.swing.text.JTextComponent |
---|
DEFAULT_KEYMAP, FOCUS_ACCELERATOR_KEY |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface com.myjavaworld.gui.MTextComponent |
---|
LOWER_CASE, MIXED_CASE, UPPER_CASE |
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 |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
MTextField()
Creates an instance of MTextField . |
|
MTextField(int columns)
Creates an instance of MTextField . |
Method Summary | |
---|---|
boolean |
canCopy()
Checks to see if text can be copied from this text component. |
boolean |
canCut()
Checks to see if text can be cut from this text component. |
boolean |
canDelete()
Checks to see if text can be deleted from this text component. |
boolean |
canPaste()
Checks to see if text can be pasted in to this text component. |
boolean |
canRedo()
Checks to see if the changes made to this component can be redone. |
boolean |
canSelectAll()
Checks to see if whole text in this component can be selected. |
boolean |
canUndo()
Cecks to see if the changes made to this text component can be undone. |
protected Document |
createDefaultModel()
|
void |
delete()
Deletes the selected text from this text component. |
int |
getCharacterCase()
Gets the current chatacter case in use by this text component. |
int |
getMaximumLength()
Returns the maximum number of characters allowed in this text component. |
int |
getUndoLimit()
Returns the current undo/redo limit of this text component. |
void |
mouseClicked(MouseEvent evt)
|
void |
mouseEntered(MouseEvent evt)
|
void |
mouseExited(MouseEvent evt)
|
void |
mousePressed(MouseEvent evt)
|
void |
mouseReleased(MouseEvent evt)
|
protected void |
processFocusEvent(FocusEvent evt)
|
void |
redo()
Redo the changes to this text component. |
void |
setCharacterCase(int characterCase)
Sets the character case to the given characterCase . |
void |
setDocument(Document model)
|
void |
setMaximumLength(int maxLength)
Sets the maxumum number of characters allowed in this text component to the given value, maximumLength . |
void |
setText(String text)
|
void |
setUndoLimit(int undoLimit)
Sets the undo/redo limit to the given limit . |
void |
undo()
Undo the changes made to this text component. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.myjavaworld.gui.MTextComponent |
---|
copy, cut, paste, selectAll |
Constructor Detail |
---|
public MTextField()
MTextField
.
public MTextField(int columns)
MTextField
.
columns
- Display sizeMethod Detail |
---|
public void setText(String text)
setText
in class JTextComponent
public void setDocument(Document model)
setDocument
in class JTextField
public void setMaximumLength(int maxLength)
MTextComponent
maximumLength
.
setMaximumLength
in interface MTextComponent
maxLength
- Maximum length to set.public int getMaximumLength()
MTextComponent
getMaximumLength
in interface MTextComponent
public void setCharacterCase(int characterCase)
MTextComponent
characterCase
.
setCharacterCase
in interface MTextComponent
characterCase
- Character case to set for this text component.public int getCharacterCase()
MTextComponent
getCharacterCase
in interface MTextComponent
public void setUndoLimit(int undoLimit)
MTextComponent
limit
.
setUndoLimit
in interface MTextComponent
undoLimit
- Number of changes to be recorded by the undo/redo manager.public int getUndoLimit()
MTextComponent
getUndoLimit
in interface MTextComponent
public void delete()
MTextComponent
delete
in interface MTextComponent
public void undo() throws CannotUndoException
MTextComponent
undo
in interface MTextComponent
CannotUndoException
public void redo() throws CannotRedoException
MTextComponent
redo
in interface MTextComponent
CannotRedoException
public boolean canCut()
MTextComponent
canCut
in interface MTextComponent
true
If the text can be cut from this text component.
false
, otherwise.public boolean canCopy()
MTextComponent
canCopy
in interface MTextComponent
true
, if text is copiable. false
,
otherwise.public boolean canPaste()
MTextComponent
canPaste
in interface MTextComponent
true
, if text is pastable. false
,
otherwise.public boolean canDelete()
MTextComponent
true
, if text can be deleted from this text
component. false
, otherwise.
canDelete
in interface MTextComponent
public boolean canSelectAll()
MTextComponent
canSelectAll
in interface MTextComponent
true
, if the text is selectable. false
,
otherwise.public boolean canUndo()
MTextComponent
canUndo
in interface MTextComponent
true
, if the changes can be undone.
false
, otherwise.public boolean canRedo()
MTextComponent
canRedo
in interface MTextComponent
true
, if the changes can be redone.
false, otherwise.public void mouseEntered(MouseEvent evt)
mouseEntered
in interface MouseListener
public void mouseExited(MouseEvent evt)
mouseExited
in interface MouseListener
public void mousePressed(MouseEvent evt)
mousePressed
in interface MouseListener
public void mouseReleased(MouseEvent evt)
mouseReleased
in interface MouseListener
public void mouseClicked(MouseEvent evt)
mouseClicked
in interface MouseListener
protected Document createDefaultModel()
createDefaultModel
in class JTextField
protected void processFocusEvent(FocusEvent evt)
processFocusEvent
in class Component
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |