Custom JScrollbar Problem (change the knob/thumb)

后端 未结 1 880
甜味超标
甜味超标 2021-01-24 01:51

I want to change the look of a JScrollBar.
I do this with overwriting/extending ScrollBarUI.
It´s no problem to change the outlook of the arrowbuttons by overwriting

1条回答
  •  生来不讨喜
    2021-01-24 02:19

    Include this on your MyScrollBarUI code:

      protected void setThumbBounds(int x, int y,int width,int height)
      {
          super.setThumbBounds(x, y, 14, 14);
      }
      protected Rectangle getThumbBounds()
      {
          return new Rectangle(super.getThumbBounds().x,super.getThumbBounds().y,14,14);
      }
      protected Dimension getMinimumThumbSize()
      {
          return new Dimension(14,14);
      }
      protected Dimension getMaximumThumbSize()
      {
          return new Dimension(14,14);
      }
    

    0 讨论(0)
提交回复
热议问题