mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

jvergara
21.23.2009 8729a061e4138420ec8a33a5ab5f4378eec2097b
opends/src/quicksetup/org/opends/quicksetup/ui/UIFactory.java
@@ -1226,6 +1226,42 @@
  }
  /**
   * Returns a JScrollPane that contains the provided component.  The scroll
   * pane will not contain any border.
   * @param comp the component contained in the scroll pane.
   * @return a JScrollPane that contains the provided component.  The scroll
   * pane will not contain any border.
   */
  public static JScrollPane createBorderLessScrollBar(Component comp)
  {
    JScrollPane scroll = new JScrollPane(comp);
    scroll.setBorder(new EmptyBorder(0, 0, 0, 0));
    scroll.setViewportBorder(new EmptyBorder(0, 0, 0, 0));
    scroll.setOpaque(false);
    scroll.getViewport().setOpaque(false);
    scroll.getViewport().setBackground(DEFAULT_BACKGROUND);
    scroll.setBackground(DEFAULT_BACKGROUND);
    setScrollIncrementUnit(scroll);
    return scroll;
  }
  /**
   * Sets the scroll increment unit for the scroll.
   * @param scroll the scroll to be updated.
   */
  public static void setScrollIncrementUnit(JScrollPane scroll)
  {
    if (scroll.getVerticalScrollBar() != null)
    {
      int increment = scroll.getVerticalScrollBar().getUnitIncrement();
      if (increment < 16)
      {
        scroll.getVerticalScrollBar().setUnitIncrement(16);
      }
    }
  }
  /**
   * Return empty insets.
   * @return empty insets.
   */