Announcement Announcement Module
Collapse
No announcement yet.
Event Pubilshing Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Event Pubilshing

    Hi !

    I'm still trying out Spring AppContext features and i'm quite stuck with the event propagation. For the purpose of the exercice, i've a made a small swing app. I have an object for the interface with basicly display a window with a small text and a button.

    My purpose is to publish the event "click on button".

    Here's the swing code :

    Code:
    pushMe.addActionListener(new java.awt.event.ActionListener() 
    		{
    			public void actionPerformed(ActionEvent e) {
    				onClickOnPushMe(e);
    			}
    		});
    I don't really know how to publish my event so that Spring will listen to this event ...

  • #2
    1. create a subclass of ApplicationEvent
    2. register a ApplicationListener within your ApplicationContext
    3. in your method (your need a reference to the applicationContext) call:
    applicationContext.publishEvent(myEvent);


    HTH.

    Comment

    Working...
    X