Text field and Text area Assignment Help

Assignment Help: >> Controls and Events - Text field and Text area

Text field and Text area:

The class TextComponent gives the functionality for editing and selecting the text. Its two subclasses TextField and TextArea inherit the functionality to implement a single line of text or multiple lines of text correspondingly.  A text in the component could be read-only or editable.

The TextField class implements a single line of optionally editable text. A size of the text field is measured in columns. A few initial text and a preferred size could be specified whenever a text field is created.

TextField( )

TextField(String text)

TextField(int columns)

TextField(String text, int columns)

// Illustrating TextField

import java.awt.*;

import java.applet.*;

public class TextFieldApplet extends Applet

{

public void init ( );

{

TextField entryField = new TextField(18);

entryField.setFont(new Font("Serif",Font.PLAIN, 12);

entryField.setText("Go ahead and type");

add(entryField);

}

}

686_Text field and Text area.png

The TextArea class implements multiple lines of optionally editable text. These lines are divided through '\n'(newline) character.   The size of the text area is measured in rows and columns.  Whenever creating text areas, the intial text and the pereferred size of the component could be specified.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd