Unforeseen Adaptation
Suppose that an existing application at Oozinoz issues warnings and prints out other messages to System.out. The commonly used expression System.out is an instance of PrintStream. Noting this and foreseeing that you might want to redirect the message output, the application's designers have built in a setOutput() method. It would be better if these designers had defined the interface they required for displaying messages. That would have let you provide an implementation for just the PrintStream methods that the application uses. But at least the setOutput() method lets you supply a different instance of PrintStream as the message channel.
Suppose that you want to redirect the messages to appear in a JText-Area object. Inspecting ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access