Text Editing in java

Text Editing

TextField

  • The TextField class implements a single-line text-entry area usually called edit-control
  • They allow user to enter strings & to edit the text using the arrow keys, cut & paste leys, & mouse selections
  • TextField is a sub-class of TextComponent
  • Constructors
    • TextField( )
    • TextField(int numChars)
    • TextField(String str)
    • TextField(String str, int numChars)
  • Methods
    • String getText( )
    • void setText(String str)
    • String getSelectedText( )
    • void select(int startIndex, int endIndex)
    • boolean isEditable( )
    • void setEditable(boolean canEdit)
    • void setEchoChar(char ch)
    • boolean echoCharIsSet( )
    • char getEchoChar( )

TextArea

A TextArea is similar to a TextField, but it can accommodate several lines of text.

Leave a Reply

Your email address will not be published. Required fields are marked *