Besides being either horizontal or vertical, a slider can also be inverted. An inverted horizontal slider moves from right-to-left. An inverted vertical slider moves from top-to-bottom.

    // Create a horizontal slider that moves left-to-right
    JSlider slider = new JSlider();
    
    // Make the horizontal slider move right-to-left
    slider.setInverted(true);
    
    // Make it vertical and move bottom-to-top
    slider.setOrientation(JSlider.VERTICAL);
    slider.setInverted(false);
    
    // Make it vertical and move top-to-bottom
    slider.setOrientation(JSlider.VERTICAL);
    slider.setInverted(true);

 

Related Examples

相关文章:

  • 2021-06-29
  • 2022-12-23
  • 2021-12-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-25
  • 2022-02-25
相关资源
相似解决方案