Adding a GUI onto the ChatRoom

I’‘m working on a plugin where I want to add a GUI I’'ve created onto a ChatRoom object (or I believe this is the right place to add it on at least).

Either way, I want it to be like that in the image of the reversi game that was being developed (seen at http://www.jivesoftware.org/articles/images/splug_rev.png).

How do I add this over on the side?

Hi Heather,

The code below should do what you’'ve looking for:

ChatManager chatManager = SparkManager.getChatManager();
chatManager.addChatRoomListener(new ChatRoomListenerAdapter() {
    public void chatRoomOpened(final ChatRoom room) {
       room.getChatPanel().add(new JTextField("Hello"), new GridBagConstraints(1, 1, 1, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
    }
});

Hope that helps,

Ryan

Message was edited by: ryang - removed some excess code

The Reversi code is also in subversion if you want to check how it was done (though it may not be up to date with the current spark rev)

Thanks,

Alex

Thank you so much Ryan, that’'s exactly what I was looking for!

I’‘m sorry, but I’'m not sure where to find that?

Hi Heather,

The Spark source (and sparkplugs) on the “Developers” tab, http://www.jivesoftware.org/source.jsp.

Hope that helps,

Ryan