Search code examples
javaswinguser-interfacejslider

Java/Swing Volume Slider


Part of my application has a media component, and I'm looking for a nice volume slider I can use rather than a JSlider which looks a bit ugly for this purpose (or specifically, an extended JSlider with custom visuals would be nice). I could write one, but I don't really want to reinvent the wheel.

In terms of "nice" volume sliders - I'm looking on the lines of something like VLC:

VLC volume slider

Is there a (free) component like this already out there that I'm missing?


Solution

  • Jasper Potts has a nice blog post about how you can skin the slider using Nimbus Look and Feel: Skinning a slider with Nimbus.

    Here is how it looks like:

    enter image description here

    By following the blog post, it's not very hard to make your own custom look on the slider. You may also be interested in my answer about customizing the JScrollPane using Nimbus Look and Feel with a full code example.