This class's constructor takes a Computer object, then constructs a JScrollPane in which the user can type commands, and the output from the Computer object will be displayed. Empty input lines are ignored. This interactive prompt supports UP and DOWN arrow command histories and basic copy/cut/paste editing.
For each user input, if the Computer object returns a String, it is displayed in blue. But if the Computer object throws an exception, the exception will be displayed in red.
Thread Safety: Can be called only by the AWT event thread.
|
|