Hello, I have built a GUI for the world of Zuul, the input can be taken by pressing buttons and enetering text commands. the output is both a change of images and text output using System.out.println().
When I press the directions buttons, the central image changes correctly. but the script response appears in the standard output window, I dont know how to make it appear on my GUI text window!
Is there a standard way to make any output from System.out.println() to appear on a certain JTextArea ? or do I have to pass all the output as a String and use (JTextArea object).setText(String text)?
this is the code i am using in the Interface class to make the text area:
//the o/p text field, the results from the i/p and the possible commands actionTextArea = new JTextArea(); actionTextArea.setFocusable(false); //no entry from users actionTextArea.setRows(10); actionTextArea.setLineWrap(true); JScrollPane scrollActionTextPane = new JScrollPane(actionTextArea); inOutText.add(scrollActionTextPane, BorderLayout.CENTER); where inOutText is: inOutText.setLayout(new BorderLayout());