0

I would ask you how to log information to JTextArea from different places(from exception and for successfully run program) using log4j in java.swing package.

Example: I have app which it have 3 checkboxes and when i check one of them and click on "run button" it must log information(print a message like if exception occurs or if is it successfully runs the program) to the JTextArea.

George
  • 75
  • 1
  • 10
  • Well, you could write a `Appender`, but if you're looking to execute an external process, there are different options available – MadProgrammer Aug 21 '18 at 10:15
  • this may be worth a look: http://www.rshingleton.com/javafx-log4j-textarea-log-appender/ – Stultuske Aug 21 '18 at 10:16
  • Don't know anything about log4j but maybe you can use the [Message Console](https://tips4java.wordpress.com/2008/11/08/message-console/) – camickr Aug 21 '18 at 14:08
  • Do you necessarily need to use log4j? You could achieve that in very simple ways. Throwing the exception you want to catch on the "run button" clicked property and wrinting something into your JTextArea is one way. –  Aug 21 '18 at 17:06
  • Ye i know that it is but i need to use log4j. – George Aug 22 '18 at 07:48

0 Answers0