New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there a simple way to add mouse event on flatlaf scrollbar component? #115
Comments
You can simply add the mouse listener to the
You probably have to change Or override method FlatLaf/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatScrollBarUI.java Lines 285 to 289 in 211030b
And maybe invoke Anyway, I think it would be nice if |
Thanks, I really appreciate it. |
@UltimateYZ Try following: hoverThumbColor = Color.red;
scrollbar.repaint(); BTW I've pushed commit fe15f44 to master branch that implements pressed colors for ScrollBars. By default the thumb is made slightly darker/lighter when pressed. You can use own colors with: UIManager.put( "ScrollBar.pressedThumbColor", Color.red ); If you like to change the pressed color dynamically, you can override method @Override
protected Color getThumbColor( JComponent c, boolean hover, boolean pressed ) {
if( pressed )
return anyColor;
return super.getThumbColor( c, hover, pressed );
} |
Thanks for the help. |
Hi JFormDesigner,
I'm trying to add a simple mouse event (mouse Pressed) to change the thumbColor paint (momentarily) from the user's mice left button input, in my flatscrollbarUI class but it doesn't work... Is there a convenient way to do it?
Pls help...
The text was updated successfully, but these errors were encountered: