try { int y = console.getCursorY(); console.clearLine(y);  out.print(currentPrompt + currentLine + " "); console.setCursor(currentPrompt.length() + posOnCurrentLine, console.getCursorY()); } catch (Exception e) { }
currentLine.refreshCurrentLine(console, currentPrompt, out);
    private void refreshCurrentLine() {        try {            int y = console.getCursorY();            console.clearLine(y);            /*             * Uncomment this to display cursor position             * console.clearLine(y-25); console.setCursor(0, y-1);             * err.print("Cursor pos : x = "+currentPrompt.length() +             * posOnCurrentLine+", y = "+y); console.setCursor(0, y);             */            out.print(currentPrompt + currentLine + " ");            console.setCursor(currentPrompt.length() + posOnCurrentLine,                    console.getCursorY());        } catch (Exception e) {        }    }