Esempio n. 1
0
  // Show the command from the command history, pointed to by the index.
  // Note that the index runs in reverse.
  private void showHistory() {
    String lShowLine;
    if (commandHistoryIndex == 0) lShowLine = currentCommand;
    else lShowLine = commandHistory.get(commandHistory.size() - commandHistoryIndex);

    replaceConsoleText(lShowLine, commandPos, textLength());
    text.setCaretPosition(textLength());
    text.repaint();
  }
Esempio n. 2
0
 private void moveCaret() {
   if (text.getCaretPosition() < commandPos) {
     text.setCaretPosition(textLength());
   }
   text.repaint();
 }