I am developing a GUI with a JTextArea to show certain messages. Two kind of messages might appear here: those written on purpose and intended for the user ("Task completed", "No file found", "Please wait"...) and those for the developer (information about exceptions, warnings, help messages...).
- So far, I am considering two options to show information on the
JTextArea: use thesetText()method, or useSystem.out.print()and redirect the output stream to theJTextArea.
Which option is better? Why?
- How can I implement a system to allow the user to select which kind
of messages are to be showed on theJTextArea? Something like aJComboBoxwith different options, so the User can select if he/she wants to get just Application Messages, or messages related to the workflow (warnings, exceptions, etc.)