Swing - replacement for Qt signal/slots
问题 In Qt GUIs it is very convenient use signals & slots - it decouple events passing. When I create some widget that throw signal, I don't have to know in advance who can get it, and later with connect I specify connections. What is parallel in Java/Swing? Can you point to good resources on this issue? 回答1: If none of the existing EventListener implementations meet your requirements, you can create your own custom event. Every JComponent contains a field of type EventListenerList. You can use