SceneBuilder Apply Gluon Theme CSS

12,570

While the Modena default themes you get in Scene Builder are part of the JavaFX built-in distribution (i.e. modena.css included in jfxrt.jar), the Gluon theme is not.

The Gluon controls and the Gluon theme that are included on Scene Builder are intended to be used in a Gluon Mobile project, that happens to run in Desktop as well as on Android and iOS devices.

You can use the Gluon plugin from your IDE to create such project. If you select MultiView with FXML project or Glisten-Afterburner project, you will have a project with FXML support. See the documentation here on how to get started.

Share:
12,570
Nisan Bahar
Author by

Nisan Bahar

Updated on June 12, 2022

Comments

  • Nisan Bahar
    Nisan Bahar almost 2 years

    I am trying to apply a theme to my jfxml window. In the GUI of Scene Builder, it shows correctly as follows: enter image description here

    But when I compile and run, it shows the button and text area like this:

    enter image description here

    I've been searching the web for 3 hours now, and came up with no CSS loading method or anything like that..

    • Oshan Mendis
      Oshan Mendis over 6 years
      That's just the theme for the scene builder application itself. Like when you change the theme of your IDE, it will show all the fancy type of buttons and all the controllers styled, but in the end your very app is using the styling you have given on your own
  • GreenROBO
    GreenROBO over 4 years
    how can I add gluon mobile css to my JavaFX desktop application?
  • José Pereda
    José Pereda over 4 years
    It is explained in my answer, you need to create a Gluon Mobile project, even if it is only intended for desktop. You can use the Gluon plugin or use any of the samples here, and then you will have it. But it requires a license.
  • GreenROBO
    GreenROBO over 4 years
    Oh ok. I got it! Thank you for your quick response!