-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTextAreaDemo.java
More file actions
37 lines (26 loc) · 851 Bytes
/
TextAreaDemo.java
File metadata and controls
37 lines (26 loc) · 851 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import java.applet.Applet;
import java.awt.*;
public class TextAreaDemo extends Applet implements TextListener
{
// TextArea echo1;
// TextArea echo2;
TextArea echo1 = new TextArea(2, 40);
TextArea echo2 = new TextArea(2, 40);
public void init(){
LayoutManager layout = new LayoutManager();
setLayout(layout);
echo1.addTextListener (this); //registered here
echo2.setEditable(false);
add(echo1);
add(echo2);
echo.setText("Enter text in this area and watch ");
}
void textValueChanged(TextEvent e)
{
String entry = echo1.getText();
echo2.setText(entry);
}
public static void main(String[] args) {
TextAreaDemo td= new TextAreaDemo();
}
}