Thursday, February 11, 2016

Program to use the various methods of TextArea.

import java.awt.*;
class txtAreaMethods extends Frame
{
public static void main(String args[] )
{
TextArea ta1 =new TextArea(5,30);
ta1.setText("The Quick Brown Fox Jumps Over The Lazy Dog");
ta1.insertText("-Java is Intenesting-",5);
ta1.replaceText("-Text Replaced-",38,50);
txtAreaMethods f1=new txtAreaMethods();
f1.setTitle("Adding a TextArea in a Frame!!!");
f1.setLayout(new FlowLayout());
f1.add(ta1 );
f1.setSize(500,500);
f1.setVisible(true );
}
}
Output:

No comments:

Post a Comment