I have the following routine:
It produces lines of data as follows:Code:private void getEngineOutput(Process engine) { try { BufferedReader reader = new BufferedReader(new InputStreamReader(engine.getInputStream()), 1); String lineRead = null; while((lineRead = reader.readLine()) != null) { textArea.append(lineRead); textArea.append("\n"); textArea.setCaretPosition(textArea.getDocument().getLength() - 0); System.out.println(lineRead); } } catch(Exception e) { e.printStackTrace(); } }
Is it possible to 'reverse' the output routine so that data outputs/prints at the top of the JTextField as opposed to outputting at the bottom? Using the above, I would like the data to print out as follows...Code:5 31 0 2250 1. e4 Nc6 2. Nc3 Nf6 3. d4 5 31 0 2853 1. e4 Nc6 2. Nc3 Nf6 3. d4 6 9 0 3192 1. e4 Nc6 2. Nc3 Nf6 3. d4 Bd6 6 9 2 4298 1. e4 Nc6 2. Nc3 Nf6 3. d4 Bd6 7 49 2 6336 1. e4!
Code:7 49 2 6336 1. e4! 6 9 2 4298 1. e4 Nc6 2. Nc3 Nf6 3. d4 Bd6 6 9 0 3192 1. e4 Nc6 2. Nc3 Nf6 3. d4 Bd6 5 31 0 2853 1. e4 Nc6 2. Nc3 Nf6 3. d4 5 31 0 2250 1. e4 Nc6 2. Nc3 Nf6 3. d4




Reply With Quote