JavaFX Java GUI Tutorial – 27 – CSS Custom Style Classes and Selectors

[ad_1]
Facebook –
GitHub –
Google+ –
LinkedIn –
reddit –
Support –
thenewboston –
Twitter –


Posted

in

by

Tags:

Comments

12 responses to “JavaFX Java GUI Tutorial – 27 – CSS Custom Style Classes and Selectors”

  1. John Arn Avatar

    Love this man. He just made me like java a whole lot more then before.

  2. Jake Salo Avatar

    pls work on your pronunciation of the word button… There are some t's in there 🙂

  3. Janine Venter Avatar

    Hi Bucky!

    I have a question, so say for example you have selector classes, how do you apply those classes using java code. Say for example you have the following style in your css:
    .combo-box-base > .arrow-button > .arrow,
    .web-view .form-select-button .arrow {
    -fx-background-insets: 1 0 -1 0, 0;
    -fx-background-color: -fx-mark-highlight-color, -fx-mark-color;
    -fx-padding: 0.166667em 0.333333em 0.166667em 0.333333em; /* 2 4 2 4 */
    -fx-shape: "M 0 0 h 7 l -3.5 4 z";
    }

    But you only want to apply the following via java code to a button: .combo-box-base > .arrow-button > .arrow, .web-view .form-select-button .arrow, how will you put this into the getStyleClass().add(…) method?

  4. Shubham Madheysia Avatar

    this works for me
    scene.getStylesheets().add(<class_name>.class.getResource("<css_filename>.css").toExternalForm());

  5. Marco Avatar

    nice tutorials but can anyone explain to me why I would use IDs instead of a class in the css file for making the label bold? IDs seem to be a bit less code but I don't see sense in it yet.
    Edit: Or can it probably be for overwriting objects that are part of the same class? Like that IDs are ranked higher than classes.

  6. Mike Cor Avatar

    Freaking awesome tutorials.

  7. A damo Avatar

    I did the stylesheet thing excatly your way. My label,button color changed but my scene's background color didn't change. Am i supposed to use something in place of .root? I'm confused help please!

  8. petya255 Avatar

    Omg, can you actually use all the css3 stuff, like transitions, hover, and everything? This is just awesome. My css knowladge is not completelly unnecesarry now.

  9. Adishwar Rishi Avatar

    Hi Bucky, can you make a video explaining the use of FXML in javafx?

  10. Lightion Avatar

    make video on charts and tabs please

  11. terran4610 Avatar

    Bucky, please make a guide on Ruby on Rails

Leave a Reply

Your email address will not be published. Required fields are marked *