MetalTheme theme = MetalLookAndFeel.getCurrentTheme(); if (theme instanceof OceanTheme && UIManager.get("ScrollBar.gradient") != null) { MetalUtils.paintGradient(g, x + 2, y + 2, w - 2, h - 4, SwingConstants.HORIZONTAL, "ScrollBar.gradient"); } else {
  private void paintThumbVertical(Graphics g, JComponent c,           Rectangle thumbBounds)  {    int x = thumbBounds.x;    int y = thumbBounds.y;    int w = thumbBounds.width;    int h = thumbBounds.height;        // first we fill the background    g.setColor(thumbColor);    if (isFreeStanding)      g.fillRect(x, y, w - 1, h);    else      g.fillRect(x, y, w, h);         // then draw the dark box    g.setColor(thumbLightShadowColor);    if (isFreeStanding)      g.drawRect(x, y, w - 2, h - 1);    else      {        g.drawLine(x, y, x + w - 1, y);        g.drawLine(x, y, x, y + h - 1);        g.drawLine(x, y + h - 1, x + w - 1, y + h - 1);      }        // then the highlight    g.setColor(thumbHighlightColor);    if (isFreeStanding)      {        g.drawLine(x + 1, y + 1, x + w - 3, y + 1);        g.drawLine(x + 1, y + 1, x + 1, y + h - 3);      }    else      {        g.drawLine(x + 1, y + 1, x + w - 1, y + 1);        g.drawLine(x + 1, y + 1, x + 1, y + h - 3);      }        // draw the shadow line    g.setColor(UIManager.getColor("ScrollBar.shadow"));    g.drawLine(x + 1, y + h, x + w - 2, y + h);  }