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?
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);
}
}
}
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.
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.