private String getCmd() { try { return text.getText(commandPos, textLength() - commandPos); } catch (BadLocationException e) { return ""; } }