views:

23

answers:

1

I have a couple questions regarding JavaFX (1.3) and CSS. First of all, when I create a CheckBox node and set its styleclass, I can't actually get the checkbox to show up. It just looks like a text-label. Do I have to specify something specific to actually get the checkbox to appear?

Also, what is the CSS class/id I would use to modify all checkboxes in a program?

+1  A: 

Have you read the JavaFX CSS Reference Guide?

http://download.oracle.com/docs/cd/E17802_01/javafx/javafx/1.3/docs/api/javafx.scene/doc-files/cssref.html

JimClarke
That was my starting point... perhaps somebody else can make more sense of the CheckBox than I did. Thanks, JimClarke.
Greg
Checkbox has a styleClass of "check-box" that includes the button and labeled CSS keys. The actual checkbox contains a Label (styleclass is supposed to be "label" not sure it is though) and a Region (box that holds check mark), the styleClass of the Region is "box". The mark is "mark". You can look at com/sun/javafx/scene/control/skin/caspian/caspian.css within <JAVAFX_HOME>/lib/desktop/javafx-ui-controls.jar for all the CSS definitions.
JimClarke
If you change the styleClass for the checkbox you would need to add a rule for the "box" and the "mark". Something like: .my-check-box *.box { -fx-padding: 3 3 3 3; .... }
JimClarke