private void shake() throws Exception {
int x = this.getLocation().x;
int y = this.getLocation().y;
for (int i = 0; i < 20; i++) {
this.setLocation(x + 20, y + 20);
Thread.sleep(20);
this.setLocation(x - 20, y + 20);
Thread.sleep(20);
this.setLocation(x - 20, y - 20);
Thread.sleep(20);
this.setLocation(x, y);
Thread.sleep(20);
}
}
private void south() {
Panel south = new Panel();
ip = new TextField(20);
ip.setText("127.0.0.1");
south.add(ip);
sendBtn = new Button("send");
saveBtn = new Button("save");
clearBtn = new Button("clear");
shakeBtn = new Button("shake");
south.add(sendBtn);
south.add(saveBtn);
south.add(saveBtn);
south.add(clearBtn);
south.add(shakeBtn);
this.add(south, BorderLayout.SOUTH);
}
private void centerPanel() {
Panel center = new Panel();
center.setLayout(new BorderLayout());
view = new TextArea();
view.setVisible(true);
view.setBackground(Color.WHITE);
view.setEditable(false);
center.add(view, BorderLayout.CENTER);
sendText = new TextArea(7, 1);
center.add(sendText, BorderLayout.SOUTH);
this.add(center, BorderLayout.CENTER);
}