Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Swing / AWT / SWT and the fly likes How to change Scroll Bar color Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "How to change Scroll Bar color" Watch "How to change Scroll Bar color" New topic
Author

How to change Scroll Bar color

Nishan Patel
Ranch Hand

Joined: Sep 07, 2008
Posts: 676

Hi,

I want to change color of Swing scroll bar horizontal and vertical scroll bar color. I worked on that a lot but I am unable to find solution for that.

So can anyone know how to change color of that scroll bar. Please find attached image for more detail.


[Thumbnail for SwingScrollBarExample.PNG]



Thanks, Nishan Patel
SCJP 1.5, SCWCD 1.5, OCPJWSD Java Developer,My Blog
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32712
    
    4
Don't know. . . . but I need practice writing Actions.Write some text into the two text components to get the scroll bars to appear.

No, you tell me why I get a colour change in the scroll bar at the bottom if I click the "vertical" button, and vice versa. Also see what you can make of the javax.swing.plaf.ScrollBarUI class. Also why the scroll handles don't change colour.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32712
    
    4
I think I have worked out why I am getting the wrong bar changing colour
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: How to change Scroll Bar color
 
Similar Threads
Which is the best way to write action listeners?
apllet
Scroll Bars
Highlighting bars on click event
Adding horizontal scroll bars to list box