What happened to SwingEventMonitor?

I am working on scalability in the user interface. Therefore, I cannot directly access the components and capture events on glass glass.

This works fine until I use auto-update components like JTextArea. Since this is an exam, I cannot use an external library to scale.

Updating the carriage is my actual problem, so I'm looking for the opportunity to get all the events without having to attach a listener to the component.

There was a SwingEventMonitor , but I can no longer find it in Java6. Is the class just renamed? I can add AWTListener using Toolkit.getToolkit () .. but since CaretEvent is a SwingEvent, it seems like I can't do it like this.

+4
source share
2 answers

This is not so convenient, but you can intercept all AWTEvent subclasses by entering an EventQueue , pushing your own queue, as shown here .

+3
source

Use SwingWorker . Here is an example .

+2
source

Source: https://habr.com/ru/post/901332/


All Articles