Activating method roomChatActivated

I want to use method roomChatActivated and this is my code :

public void chatRoomActivated(final ChatRoom room){

System.out.println(“room activated”);

if (room.getChatType().toString()==“chat”){

room.getToolBar().addChatRoomButton(Videobutton);

room.getToolBar().addChatRoomButton(Audiobutton);

}

Videobutton.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e) {

//Action

}

});

Audiobutton.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e) {

//Action

}

});

}

method chatRoomActivated is contained in class chatRoomListenerAdapter. With this code, i want to add a button at a chat room when activated again. But my code is didn’'t work… Anybody can help me??

First off, it looks like the method is not being fired off. I went ahead and fixed that for Spark 2.0.9, but regardless, from the look of your code, you should be using chatRoomOpened method.

So…

public void chatRoomOpened(final ChatRoom room) {

if (room instanceof ChatRoomImpl) {

room.getToolBar().addChatRoomButton(videobutton);

room.getToolBar().addChatRoomButton(audiobutton);

}

}

// Then add your actions

Cheers,

Derek

Thnx for ur reply…

I had trying your code…

before i am using methode ChatRoomActivated, i have declared methode ChatRoomOpened. But it’‘s still didn’‘t work… i want to make my button is appear on all tab of chatroom. that’‘s why i’'m trying to use methode ChatRoomActivated. Do you have any suggestion?