How can I style a JavaFX Splitmenubutton in CSS

Source: Internet
Author: User

0 down vote Favorite

I try to style a Splitmenubutton in JavaFX. I ' ve got a Menubutton and a splitmenubutton in my fxml-file.

My Css-file looks like this:

.Menu-button{ -Fx-Background-Color:Red; }.Split-Menu-button.label { -fx -background-color:< Span class= "PLN" > Green;}.-menu-button .< Span class= "PLN" >arrow { -fx -background-color:< Span class= "PLN" > Yellow;               /span>                

But I can ' t figure out what to style of the area around the arrow for the Splitmenubutton. I tried several ways, but nothing worked

.Split-Menu-button.Menu-button{ -Fx-Background-Color:Blue; }.Split-Menu-button.Menu-button.Label{ -Fx-Background-Color:Blue; }.Split-Menu-button.Menu{ -Fx-Background-Color:Blue; }.Split-Menu-button.Menu-Item{ -Fx-Background-Color:Blue; }.Split-Menu-button.button{ -fx-background-color: Blue;}.-menu-button .< Span class= "PLN" >menu-bar { -fx-background-color: Blue;               /span>                
CSS JavaFX javafx-2 javafx-8 fxml
Share|improve this question Edited at 10:58
Asked at 10:20 Stef
32
Add a Comment
1 Answer Active oldest votes
Up vote 2 down vote accepted

There is, useful techniques for figuring out, the style classes for individual parts of complex.

    1. Extract The default style sheet, Modena.css, from the Jfxrt.jar file and see how the default styles is defined (you can a LSO find MODENA.CSS Online)
    2. Use Scenicview to inspect your application when it ' s running

In this case I used Scenicview; The CSS need is

.split-menu-button .arrow-button { -fx-background-color: yellow ;}

How can I style a JavaFX Splitmenubutton in CSS

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.