private void buttonMoveCursorActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_buttonMoveCursorActionPerformed TerminalSize terminalSize = scrollingSwingTerminal.getTerminalSize(); Random random = new Random(); scrollingSwingTerminal.setCursorPosition( random.nextInt(terminalSize.getColumns()), random.nextInt(terminalSize.getRows())); scrollingSwingTerminal.flush(); } // GEN-LAST:event_buttonMoveCursorActionPerformed
private void printLines(int howMany) { Random random = new Random(); String selection = "abcdefghijklmnopqrstuvxyzåäö"; for (int i = 0; i < howMany; i++) { int words = random.nextInt(10) + 1; for (int j = 0; j < words; j++) { int length = random.nextInt(10) + 2; for (int k = 0; k < length; k++) { scrollingSwingTerminal.putCharacter(selection.charAt(random.nextInt(selection.length()))); } scrollingSwingTerminal.putCharacter(' '); } scrollingSwingTerminal.putCharacter('\n'); } scrollingSwingTerminal.flush(); }