diff --git a/src/net/java/sip/communicator/impl/gui/main/message/ChatWindow.java b/src/net/java/sip/communicator/impl/gui/main/message/ChatWindow.java index a603679d7..2497373e2 100755 --- a/src/net/java/sip/communicator/impl/gui/main/message/ChatWindow.java +++ b/src/net/java/sip/communicator/impl/gui/main/message/ChatWindow.java @@ -151,13 +151,17 @@ public void actionPerformed(ActionEvent e) AbstractAction changeTabForword = new AbstractAction(){ public void actionPerformed(ActionEvent e) { - if(chatTabbedPane != null - && chatTabbedPane.getSelectedIndex() - < chatTabbedPane.getTabCount() - 1){ - - ChatWindow.this.chatTabbedPane - .setSelectedIndex - (chatTabbedPane.getSelectedIndex() + 1); + if(chatTabbedPane != null){ + if(chatTabbedPane.getSelectedIndex() + < chatTabbedPane.getTabCount() - 1){ + ChatWindow.this.chatTabbedPane + .setSelectedIndex + (chatTabbedPane.getSelectedIndex() + 1); + } + else{ + ChatWindow.this.chatTabbedPane + .setSelectedIndex(0); + } } } }; @@ -165,12 +169,17 @@ public void actionPerformed(ActionEvent e) AbstractAction changeTabBackword = new AbstractAction(){ public void actionPerformed(ActionEvent e) { - if(chatTabbedPane != null - && chatTabbedPane.getSelectedIndex() != 0){ - - ChatWindow.this.chatTabbedPane + if(chatTabbedPane != null){ + if(chatTabbedPane.getSelectedIndex() != 0){ + ChatWindow.this.chatTabbedPane + .setSelectedIndex + (chatTabbedPane.getSelectedIndex() - 1); + } + else{ + ChatWindow.this.chatTabbedPane .setSelectedIndex - (chatTabbedPane.getSelectedIndex() - 1); + (chatTabbedPane.getTabCount() - 1); + } } } };