-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtextAreaOpertions.java
More file actions
50 lines (37 loc) · 979 Bytes
/
textAreaOpertions.java
File metadata and controls
50 lines (37 loc) · 979 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
38
39
40
41
42
43
44
45
46
47
48
49
50
import java.awt.*;
import java.awt.event.*;
class myframe extends Frame implements ActionListener
{
Label l;
TextArea ta;
TextField tf;
Button b;
public myframe()
{
super("text_Area_Operations");
l = new Label("nothing is written");
ta = new TextArea(20,30);
tf = new TextField(20);
b = new Button("Click");
b.addActionListener(this);
setLayout(new FlowLayout());
add(l);
add(ta);
add(b);
add(tf);
}
public void actionPerformed(ActionEvent e)
{
// l.setText(ta.getSelectedText());
//l.setText(ta.getText());
ta.insert(tf.getText(),ta.getCaretPosition());
}
}
public class textAreaOpertions {
public static void main(String arg[])
{
myframe f=new myframe();
f.setSize(800,800);
f.setVisible(true);
}
}