Notifying Classes

I'm in the process of creating an IRC bot, and for the most part, its coming along nicely.

Currently, I'm trying to write an ErrorListener class that notifies other classes of the assorted errors send by the server. The first thing I would like to do is handle NickInUseExceptions (another of my own classes) after running the LogIn code, but I'm not entirely sure about notifying the class that contains the login code about a NickInUseException.

My basic idea:

Class NickOperations contains the login code. The login code 'registers' with the ErrorListener class, which will notify the LogIn code (method) about the error.

Any ideas on how to get this done?

[697 byte] By [timothyb89_a] at [2007-11-27 9:35:04]
# 1
Check out Observer/Observable
tjacobs01a at 2007-7-12 23:01:10 > top of Java-index,Java Essentials,Java Programming...