Added clear button, moved buttons into a panel.

This commit is contained in:
beard%netscape.com 1999-03-12 21:51:05 +00:00
Родитель 485f84c26f
Коммит 221c8ea624
1 изменённых файлов: 24 добавлений и 11 удалений

Просмотреть файл

@ -35,27 +35,40 @@ import java.applet.*;
import java.awt.event.*;
public class ConsoleApplet extends Applet {
TextArea text;
TextArea console;
public ConsoleApplet() {
setLayout(new BorderLayout());
add(text = new TextArea(), BorderLayout.CENTER);
add(console = new TextArea(), BorderLayout.CENTER);
ActionListener dumpThreadsListener =
new ActionListener() {
public void actionPerformed(ActionEvent e) {
dumpThreads();
}
};
Panel panel = new Panel();
add(panel, BorderLayout.SOUTH);
// clear console button.
ActionListener clearConsoleListener = new ActionListener() {
public void actionPerformed(ActionEvent e) {
console.setText("");
}
};
Button clearConsole = new Button("Clear");
clearConsole.addActionListener(clearConsoleListener);
panel.add(clearConsole);
// dump threads button.
ActionListener dumpThreadsListener = new ActionListener() {
public void actionPerformed(ActionEvent e) {
dumpThreads();
}
};
// Create a dump threads button.
Button dumpThreads = new Button("Dump Threads");
dumpThreads.addActionListener(dumpThreadsListener);
add(dumpThreads, BorderLayout.SOUTH);
panel.add(dumpThreads);
}
public void init() {
Console.init(text);
Console.init(console);
}
public void destroy() {