java - Ways of moving scrollbar in JFileChooser -


i have jfilechooser , want controll gestures. have done far measure speed of swiping gesture , send signal mouse wheel. here code:

private void mousewheelmove(swipegesture swipe){     if (swipe.direction().getx() < 0){          if (swipe.speed()< 1000f){             robot.mousewheel(1);         }         if (swipe.speed()>=1000f && swipe.speed() < 3000f){             robot.mousewheel(2);         }         if (swipe.speed()>=3000f && swipe.speed() < 4500f){             robot.mousewheel(3);         }         if (swipe.speed()>=4500f){             robot.mousewheel(4);         }     }     if(swipe.direction().getx() > 0){          if (swipe.speed()< 1000f){             robot.mousewheel(-1);         }         if (swipe.speed()>=1000f && swipe.speed() < 3000f){             robot.mousewheel(-2);         }         if (swipe.speed()>=3000f && swipe.speed() < 4500f){             robot.mousewheel(-3);         }         if (swipe.speed()>=4500f){             robot.mousewheel(-4);         }     } } 

is there other way this? because movement rough. wanted scroll slow when swipe slow etc. jumps end of scroll bar. can give me hint?


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -