From: Felix B. <bf...@gm...> - 2003-05-15 23:46:31
|
On Saturday 10 May 2003 02:27, Fabrice Michellonet wrote: > 1 - ONLY 1 LISTENER > only your main class add a listener, and then dispatch msg to the > differents tab (i.e TabbedPane). This approach doesn't solve the problem it's just shifted into a different place where I have duplicate the code you've already written. If you provide listeners you should do it in a way many listeners can be registered and not only one. Have a look a swing's listener code, they use, as far as I could see, arrays for managing their action listeners for instance, if one of those listeners triggers an action that subscribes a new listener it won't be notified of the same event. But you don't have to change it, if I can rely on the fact that the newly registered listener gets the message event at all rates that's fine with me too. > 2 - X LISTENERS > At the beginning create an invisible Tab with a Listener. When you receive > the first message, make the first tab visible and create a new invisible > one with a new Listener. Repeat for every different users. > Then, each Tab will only display messages from 1 users, even if they > receive all messages. This is impossible due to XNap's plugin architecture, I don't directly access the gui from the plugin's code, I just register a new JOscarChannel with the ChatManager when a user starts talking to us. Sincerely, Felix -- Use Debian GNU/Linux! http://www.felix.beldesign.de |