Class TextAreaHandler

java.lang.Object
java.util.logging.Handler
madkit.logging.TextAreaHandler

public class TextAreaHandler extends Handler
This class extends the Handler class to provide a custom log handler that outputs log records to a JavaFX TextArea. It overrides the publish, flush, and close methods to handle log records appropriately.
See Also:
  • Constructor Details

    • TextAreaHandler

      public TextAreaHandler(TextArea area)
      Constructs a new TextAreaHandler with the specified TextArea.
      Parameters:
      area - the TextArea to which log records will be appended
  • Method Details

    • publish

      public void publish(LogRecord log)
      Publishes the given log record by appending it to the TextArea if it is loggable.
      Specified by:
      publish in class Handler
      Parameters:
      log - the log record to be published
    • flush

      public void flush()
      Flushes any buffered output. This implementation does nothing.
      Specified by:
      flush in class Handler
    • close

      public void close() throws SecurityException
      Closes the handler and releases any associated resources. This implementation does nothing.
      Specified by:
      close in class Handler
      Throws:
      SecurityException - if a security manager exists and if the caller does not have LoggingPermission("control")