I'm working on a Java project making use of SWT where I wanted a nice user interface for the configuration panel: something modern and nice looking. I was inspired by the simple design of Gnome 3.

SWT widget does not provide a switch button out of the box. Various projects are proposing a switch button and I’ve tried many of them without falling in love with any. The best one is proposed by Opal project, but it misses some feature and had drawing issue in some edges cases.

I've fork the widget to propose my own version.


See how it looks.

Preview in Windows XP

Preview in Windows 7

Preview in Gnome 3 (GTK2)


The code is available on github.

You may used it in your maven project as follow:

{% highlight html %} patrikdufresne https://nexus.ikus-soft.com/content/repositories/public/ ... com.patrikdufresne com.patrikdufresne.switchbutton 1.0-SNAPSHOT

Category: • 2015-06-19
Share this post