• Post Reply Bookmark Topic Watch Topic
  • New Topic

Two JSCROLL bars to slide at same time

 
aditya parvatam
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JScrollPane fileScroll1=new JScrollPane(file1);
JScrollPane fileScroll2=new JScrollPane(file2);
I made two scroll bars to display two files
but i want to slide them at a time
how to make them slide at same time
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
set the scrollpane's scrollBar models the same

sp2.getVerticalScrollBar().setModel(sp1.getVerticalScrollBar().getModel());
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!