Java Reference
In-Depth Information
buttons.add(connectButton);
abortButton.addActionListener(this);
buttons.add(abortButton);
pack();
}
public void actionPerformed (ActionEvent ev) {
if (ev.getSource() == connectButton) {
host = hostField.getText();
nick = nickField.getText();
connect();
}
setVisible (false);
}
}
class RefreshTask extends TimerTask {
public void run() {
try {
Toolkit.getDefaultToolkit()
.getSystemEventQueue()
.invokeAndWait (new Runnable() {
public void run() {
transfer (null);
}
}
);
}
catch (Exception e) {
}
}
}
static String readLine (Reader reader) throws IOException {
StringBuffer buf = new StringBuffer();
while (true) {
int c = reader.read();
if (c == -1) {
if (buf.length() == 0) return null;
break;
}
if (c == '\n') break;
if (c != '\r') buf.append ((char) c);
}
return buf.toString();
}
public PdapChat() {
frame.add("Center", list);
Panel input = new Panel (new BorderLayout());
frame.add("South", input);
input.add("Center", text);
Panel buttons = new Panel();
input.add("South", buttons);
buttons.add(submitButton);
buttons.add(configButton);
submitButton.addActionListener(this);
configButton.addActionListener(this);
frame.addWindowListener(new WindowAdapter() {
public void windowClosing (WindowEvent e) {
destroyApp (true);
Search WWH ::




Custom Search