From 97754c45f140f075295fd20e58dcd3472344c8b6 Mon Sep 17 00:00:00 2001 From: Yana Stamcheva Date: Mon, 24 Apr 2006 15:33:45 +0000 Subject: [PATCH] key switching through msg tabs should loop - Bug fixed --- .../impl/gui/main/message/ChatWindow.java | 33 ++++++++++++------- 1 file changed, 21 insertions(+), 12 deletions(-) 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); + } } } };