Hello friend,
I hope something below code may help you to know about TextArea class:
Code:
import java.applet.Applet;
import java.awt.Graphics;
import java.awt.TextArea;
public class TextAreaDM extends Applet {
TextArea display = new TextArea(1, 90);
int paintCount1 = 0;
String newline1;
public void init() {
display1 = new TextArea(1, 90);
display1.setEditable(false);
add(display1);
newline1 = System.getProperty("line.separator");
addItem("init: " + threadInfo(Thread.currentThread()));
}
public void start() {
addItem("start: " + threadInfo(Thread.currentThread()));
}
public void stop() {
addItem("stop: " + threadInfo(Thread.currentThread()));
}
public void destroy() {
addItem("destroy: " + threadInfo(Thread.currentThread()));
}
String threadInfo(Thread t) {
return "thread=" + t1.getName() + ", " + "thread group="
+ t1.getThreadGroup().getName();
}
public void update(Graphics g1) {
addItem("update: " + threadInfo(Thread.currentThread()));
super.update(g1);
}
}
Bookmarks