Skip to content

antoniopelusi/JavaFX-Dark-Theme

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

JavaFX-Dark-Theme 🌘

A complete CSS stylesheet to set a dark theme in your JavaFX UI.

Built on top of the default JavaFX theme (Modena)


How to use

  • Load via FXML:

    Add stylesheets="@style.css" to the top-level FXML tag.


  • Load via Java: Add the following code:
    File style = new File("relative-path/style.css");
    scene.getStylesheets().add(style.toURI().toURL().toExternalForm());
    
    or (online version)
    scene.getStylesheets().add("https://raw.githubusercontent.com/antoniopelusi/JavaFX-Dark-Theme/main/style.css");
    

CSS preview example

See this theme in action here!


List of JavaFX recolored elements

  • Label
  • Pane
  • GridPane
  • TextField
  • ComboBox
  • ChoiceBox
  • ListCell
  • ListView
  • Button
  • CheckBox
  • TextArea
  • ScrollBar
  • Menu
  • ProgressBar
  • Slider
  • TreeView
  • Tab
  • TitledPane
  • TableView
  • Tooltip