public static void scrollHorizontally(JComponent c, int position) {
    final JScrollPane pane = findScrollPane(c);
    if (pane != null) {
      final JScrollBar bar = pane.getHorizontalScrollBar();
      if (bar != null) {
        bar.setValue(position);
      }
    } else {
      final JScrollBar scrollBar = findHorizontalScrollBar(c);
      if (scrollBar != null) {
        scrollBar.setValue(position);
      }
    }
  }
public static void scrollHorizontally(JComponent c, int position)