My name is Pedro DV. I’m a Software Engineer and Software Designer. I work as a
JavaFX and Swing Freelancer and
Consultant, but more generally can be described as a Front End Freelancer and Consultant
since I also have experience in web technologies, building web apps, etc,
and have experience in
User Interface Design
and User Experience.
I’ve been creating user interfaces, professionally, since 2006. More information here and for a detailed
CV style report my LinkedIn page.
I've worked directly with clients or as a sub-contractor.
Going through JMetro I just remembered the Toggle Switch control that I have created. It reminded me that this should be in a control repository next to other controls, publicly available for anyone to grab. I think this is one of those controls that should be part of the java sdk, it’s very popular especially on touch based devices. For more information read my previous blog post on the Toggle Switch control.
I have heard more than once people saying why a new control, why not simply style the Checkbox to appear the same way as a Toggle Switch. I think Toggle Switch merits being its own control the same way the Radio Button and Checkbox aren’t just skins of the Toggle Button, besides being conceptually a different control a Checkbox has the indeterminate state which doesn’t make sense in a Toggle Switch. Toggle Switch are usually also animated which can’t be achieved by skinning. And finally creating a Toggle Switch control makes it easier for others to style the control in different ways via css (styling a Checkbox to look like a Toggle Switch is difficult and hacky) .
One of the pertinent feedbacks I’ve received from the project members was that the default skin should be inline with the Modena theme. And so I created a new css stylesheet that I think is inline with Modena and is the default look of the control (if you don’t override the default stylesheet).
A Toggle Switch is a control that is very popular nowadays, especially on touch based devices. You can see it in Android:
In iOS (6 and 7):
And in Windows 8:
Functionally it works just like a check-box but for touch devices it has one big advantage: when your finger is over the touch device it won’t obscure the control and so you can see an instant feedback when you press it. The disadvantage is obviously that this control takes up more space.
My implementation of the Toggle Switch allows you to change the text for the on and off state that appears right next to the toggle switch. You can also style the control using just CSS. It comes with a CSS implementation that gives it a metro look.
Below you can see a live demonstration of the control, in a light and a dark theme.
Toggle Switch (JMetro Light Theme)
Toggle Switch (JMetro Dark Theme)
You can grab the control and the accompanying metro style CSS by going to the jfxtras repository.
Currently it’s still not possible to style the Toggle Switch to look like the Android toggle switch using just CSS because it’s not possible to specify that the on and off text should appear inside the control and not outside as in the case of Metro. I’d also like to add the possibility to turn the animation on or off through CSS.