4

JavaFX Dark Theme

 1 year ago
source link: https://www.antoniopelusi.com/posts/javafx-dark-theme/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
JavaFX Dark Theme

JavaFX Dark Theme

Posted Oct 12, 2022 Updated Oct 17, 2022
By Antonio Pelusi
1 min read

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

Download stylesheet here!

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());
    

CSS preview example

See this theme in action here!

Download stylesheet here

List of JavaFX recolored elements

  • Label
  • GridPane
  • TextField
  • ComboBox
  • ListCell
  • ListView
  • Button
  • CheckBox
  • TextArea
  • ScrollBar
  • ProgressBar
  • Slider
  • TreeView
  • TitledPane
  • TableView
  • Tooltip
This post is licensed under CC BY 4.0 by the author.
Share

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK