TEXTAREA Control Of AWT – EXAMPLE

The item marked as 1 is the AWT TextArea control. We will add this control to the center of AWT Frame and you can see it occupies 80% of the space. Towards the bottom we add three more AWT Controls. First one is the TextField (Marked as 2) and after that we add an AWT Button (Marked as 3). Finally, we add a Checkbox Control (Marked as 4) and we use this check box to insert text in the TextArea control.
We can type a line of text in the TextField and click on the Add Text button. This will add a single line of text in the AWT TextArea Control. Each time we click Add Text button, a new line of text is added to the TextArea Component. When the check box not checked, we are in text selection mode. User can move their mouse and select any text and delete it or add text manually by changing the cursor position through the mouse.
When the Check box is in checked state, we are in Text-Insert mode. We can type a word or line of text in the text field and then click the mouse cursor at a different location on the TextArea Control to insert it. This way we can insert same text at different location quickly.