Skip to content

JavaFX Day-Night Toggle Button - Custom Control implemented with JavaFX

Notifications You must be signed in to change notification settings

alainkaiser/JavaFX-Day-Night-Toggle-Button

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JavaFX Day-Night Toggle-Button

JavaFX Day-Night Toggle Button - Custom Control implemented with JavaFX

'Preview'

How to implement?

  1. Copy DayNightToggleButton.java and style.css in your Java FX Project. Be sure that you have a Java JDK installed which includes JavaFX.

  2. Create your business related presentation model with a property for the day-night toggle button

    private final BooleanProperty isDay = new SimpleBooleanProperty();
  3. Create an instance of the day-night toggle button and pass it to your ui

    // Declaration custom control
    private DayNightToggleButton dayNightToggleCustomControl;
    
    // Init custom control
    dayNightToggleCustomControl = new DayNightToggleButton();
  4. Setup all relevant property bindings

    dayNightToggleCustomControl.isToggledProperty().bindBidirectional(pm.isDayProperty());
  5. Have fun 🎉

About

JavaFX Day-Night Toggle Button - Custom Control implemented with JavaFX

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published