I'm revisiting some older projects and a new build with the latest library has added an ugly scroll bar to my scrolling containers and lists.
I put in theme entries for 'Scroll' and "ScrollThumb" with transparency 0 and border empty. It removed some but not all, ticking or unticking scroll visible in the Designer doesn't seem to have much effect.
This happened sometime in the last few weeks. I can't find a pattern of what's causing it. (I think it may be new in v3.5).
Here is my trick for removing scrollbar everywhere:
UIManager.getInstance().setLookAndFeel(new DefaultLookAndFeel(UIManager.getInstance()) {
@Override
public void bind(Component cmp) {
if (cmp instanceof Container) {
cmp.setScrollVisible(false);
}
}
});
I placed that piece of code in the init method of my main class.
Edit (May 09 2019):
You may experience some weird UI behavior using the code above. My experience so far is RadioButton and Checkbox components not rendering properly when I change their images with the code below:
((DefaultLookAndFeel) UIManager.getInstance().getLookAndFeel()).setCheckBoxImages(checkedImage, unCheckedImage);
((DefaultLookAndFeel) UIManager.getInstance().getLookAndFeel()).setCheckBoxFocusImages(checkedImage, unCheckedImage, checkedImage, unCheckedImage);
Solution (May 09 2019):
Add the following to the init method of your main class:
UIManager.getInstance().getLookAndFeel().setFocusScrolling(false);
UIManager.getInstance().getLookAndFeel().setFadeScrollBar(false);
...and set a theme constant scrollVisibleBool to false. (I think CN1 defaults this to false but I still set it anyway).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With