Results 1 to 2 of 2

Thread: Event Pubilshing

  1. #1

    Default 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. #2
    Join Date
    Aug 2004
    Location
    Montréal, Canada
    Posts
    845

    Default

    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.
    Omar Irbouh

    Spring Modules Team
    http://irbouh.blogspot.com/

Similar Threads

  1. Generalizing context event support?
    By jbetancourt in forum Container
    Replies: 0
    Last Post: Sep 4th, 2005, 09:49 AM
  2. Event parameter usage
    By akw in forum Web Flow
    Replies: 1
    Last Post: Aug 28th, 2005, 02:50 AM
  3. Replies: 1
    Last Post: Aug 23rd, 2005, 07:49 PM
  4. Loosing my SecureContext
    By sklakken in forum Security
    Replies: 3
    Last Post: Jul 21st, 2005, 01:44 PM
  5. Event on access to a bean
    By belaran in forum Container
    Replies: 5
    Last Post: Jul 5th, 2005, 04:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •