Creating a type of toggle with two labels..

Jonathan Giles jonathan.giles at
Wed Dec 4 13:39:39 PST 2013

It is likely significantly easier to simply roll your own control and
not try to coerce ButtonBase to support two labels.

For what it is worth, Paru and I talked about precisely this control at
JavaOne 2012, which you can watch on YouTube here:

-- Jonathan

On 5/12/2013 10:16 a.m., Pedro Duque Vieira wrote:
> Hi,
> I'm trying to create a new control to be used by other developers. It is
> know as "Toggle Switch".
> You can see this control in android:
> in iOS:
> (search for "Toggle Switch") and
> on Windows 8:
> (below
> "Step 2").
> My approach was to subclass ButtonBase which is itself a subclass of
> Labeled. The problem here is that Labeled only accepts one label but the
> Toggle Switch needs two: one for the "on" state and another for the "off".
> Any ideas on how to best approach this problem?
> Thanks in advance, regards,

More information about the openjfx-dev mailing list