0

I am creating custom Scrollbar. I found the thumb will travel into half of the end buttons on the track when I change to Nimbus LnF. On MetalLookAndFeel, the thumb will stop right before the end buttons.

Is there a way to fix this?

enter image description here

Here is a working code example . Please use the second answer's code and do three changes: 1. use Nimbus LnF; 2. comment out createDecreaseButton() and createIncreaseButton() methods; 3. make MyScrollbarUI class extends BasicScrollBarUI

Community
  • 1
  • 1
peterboston
  • 749
  • 1
  • 6
  • 21
  • If you're using Nimbus, can't you just skin it? See [Nimbus Look and Feel](https://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/nimbus.html) (Nimbus is based on Synth Look and Feel) – MadProgrammer Sep 25 '15 at 03:01
  • I am not really understand the "skin" here. What I want to do is make the scrollbar "flat". – peterboston Sep 25 '15 at 03:35
  • 2
    Nimbus, been based on Sythn, has a CSS like language which can be used to modify the UI (or "skin" it) without the need to write (a lot) of more code. I suggest you have a look at the links above – MadProgrammer Sep 25 '15 at 03:37
  • @MadProgrammer, thank you for your link. I think I found the solution for this issue based on the link you gave to me. I am trying to head the right direction you pointed. But I have issues you may can help me. Please have a look at this question: http://stackoverflow.com/questions/32785063/how-to-implement-painter-to-use-my-image-for-the-scrolllbar-button-in-nimbus-lnf – peterboston Sep 25 '15 at 15:03

1 Answers1

0

Thanks for MadProgrammer. He points me to the right direction and I found the solution:

ScrollBar.decrementButtonGap and ScrollBar.incrementButtonGap properties will control these gaps.

Kyle Falconer
  • 7,586
  • 5
  • 44
  • 63
peterboston
  • 749
  • 1
  • 6
  • 21