title: Switch vertical JScrollBar min/max location
body: <p>I have a <em>vertical</em> <code>JScrollBar</code> which default behaviour is to show the thumb at the <em>top</em> when the scrollbar value is at the model <em>minimum</em>.</p>
  
  <p>I'd like to have the opposite behaviour: the thumb would be at the <em>bottom</em> when the value is at the minimum.</p>
  
  <p>I have tried <code>setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT)</code> and it works for <em>horizontal</em> scrollbars but not for vertical ones...</p>
  
  <p>How can I get it to work as expected (without creating a full <code>ScrollBarUI</code> if possible)?
  Is that expected behaviour (a kind of "UI inconsistency"* between horizontal and vertical scrollbars, or a missing <code>ComponentOrientation.BOTTOM_TO_TOP</code> constant)?</p>
  
  <p>Here is some SSCE that illustrate the problem:</p>
  
  <pre><code>public static void main(String[] args) throws Exception {
      JFrame f = new JFrame();
      f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      int orient = JScrollBar.VERTICAL; // &lt;&lt;--- Change to HORIZONTAL
      JScrollBar sb = new JScrollBar(orient, 0, 100, 0, 1000);
      sb.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); // &lt;&lt;--- Works only for HORIZONTAL
      sb.addAdjustmentListener(new AdjustmentListener() {
          @Override public void adjustmentValueChanged(AdjustmentEvent e) {
              System.out.println(e.getValue());
          }
      });
      f.add(sb);
      if (orient == JScrollBar.HORIZONTAL)
          f.setBounds(100, 100, 500, 100);
      else
          f.setBounds(100, 100, 100, 500);
      f.setVisible(true);
  }
  </code></pre>
  
  <p>*: "inconsistency" because if it reverses the thumb for horizontal, I would expect the thumb to be reversed as well for vertical...</p>
  
  <p>EDIT: The scrollbar is used to control scrolling in a map that can be configured to have its origin at the top-or-bottom of the screen, going down-or-up, or at the left-or-right, going right-or-left (it has to match a physical setup, so is configurable). Handling the left-or-right setup is just setting the scrollbar to horizontal, with right-to-left orientation, but the same is not working for vertical.</p>
  
  <p>I also checked the source of <code>BasicScrollBarUI</code> and it indeed handles the <code>getComponentOrientation().isLeftToRight()</code> <em>only</em> when the scrollbar is <code>HORIZONTAL</code>. So it is indeed expected behaviour (just not the one <em>I</em> expected...).</p>