简体   繁体   中英

Change JScrollBar arrow height

How do you change the height of the arrows in JScroll Bar? I was able to change the width of the Scrollbar but the height of arrows were still small. Thanks for your help.

Painting is done by a couple of BasicArrowButtons, which have this in their paint method:

// Draw the arrow
size = Math.min((h - 4) / 3, (w - 4) / 3);
size = Math.max(size, 2);
paintTriangle(g, (w - size) / 2, (h - size) / 2,
                    size, direction, isEnabled);

So need to create a class which paints the arrows differently, then a ScrollBarUI that adds these arrows to your JScrollBar, then set that on your JScrollBar.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM