コード例 #1
0
  private void showHelp(String help[]) {

    txtCommand.setText(help[0]);

    bHelp = true;

    pResult.removeAll();
    pResult.add(txtResultScroll, BorderLayout.CENTER);
    pResult.doLayout();
    txtResult.setText(help[1]);
    pResult.repaint();
    txtCommand.requestFocus();
    txtCommand.setCaretPosition(help[0].length());
  }
コード例 #2
0
 // called by the Client to append text in the TextArea
 void append(String str) {
   chatArea.append(str);
   chatArea.setCaretPosition(chatArea.getText().length() - 1);
 }