Scrolling problem with JScrollPane

We have a JSplitPane which has vertical and horizontal scroll bars, so we have a left pane and right pane . If I scroll to th extreme right and click on a cell and scroll back to the left, On the left pane if I click on a cell, the scroll bar on right pane aotomatically moves to right.

How can we avoid having the scroll bar moving to right?

[355 byte] By [screen_simua] at [2007-11-27 5:16:58]
# 1
So you have a JTable on both sides of the split pane? And both tables are in a JScrollPane? Is the same instance of JTable added to both sides? Do you have any action or mouse listeners added to anything?
hunter9000a at 2007-7-12 10:39:49 > top of Java-index,Java Essentials,Java Programming...
# 2

Yes we have mouse listeners

addPopupListener(new MouseListener(){

public void mouseClicked(MouseEvent e)

{

if(e.getSource() instanceof APTable)

{

isSelected = true;

if (buddyTable != null)

{

buddyTable.setSelected(false);

}

}

}

screen_simua at 2007-7-12 10:39:49 > top of Java-index,Java Essentials,Java Programming...
# 3
It looks to me like when you click on one table, you're changing the other table's selection? That would explain why the scroll bar changes on the other table. It's scrolling to put the new selection in the window. Of course, I'm mostly guessing since you haven't given much detail.
hunter9000a at 2007-7-12 10:39:49 > top of Java-index,Java Essentials,Java Programming...
# 4

Swing related questions should be posted in the Swing forum.

If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program[/url] (SSCCE) that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.

Don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags[/url] so the posted code retains its original formatting.

camickra at 2007-7-12 10:39:49 > top of Java-index,Java Essentials,Java Programming...