Results 1 to 2 of 2
  1. #1
    IYIaster is offline Member
    Join Date
    Jul 2009
    Posts
    46
    Rep Power
    0

    Default addPropertyChangeListener

    I'm trying to use a addPropertyChangeListener so I can use a progress bar to get the progress of a thread. Everything I try will not allow me to add a property change listener.

    Java Code:
                
    final install7 t = new install7();
    new Thread(t).start();

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,000
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by IYIaster View Post
    I'm trying to use a addPropertyChangeListener so I can use a progress bar to get the progress of a thread. Everything I try will not allow me to add a property change listener.

    Java Code:
                
    final install7 t = new install7();
    new Thread(t).start();
    The object that wants to fire PropertyChangeEvents to PropertyChangeListeners should have a PropertyChangeSupport member object. Listeners register themselves to this PropertyChangeSupport class (optionally with the name of the event they're interested in). Normally those classes that own the PropertyChangeSupport object have delegating add- and remove- propertyChangeListener methods because it's non of the listeners business how and where they are finally registered.

    Read the API documentation for all the mentioned classes.

    kind regards,

    Jos

Posting Permissions

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