JavaFX CSS Reference Guide
JavaFX CSS Reference Guide
JavaFXCSSReferenceGuide
lastupdated:27May2010
Contents
Introduction
CSSandtheJavaFXSceneGraph
Limitations
Inheritance
Examples
Types
inherit
<boolean>
<number>&<integer>
<string>
<size>
<uri>
<effect>
<font>
<paint>
<color>
Nodes
javafx.scene
Node
Group
Scene
javafx.scene.image
ImageView
javafx.scene.layout
ClipView
Container
Flow
HBox
Stack
Tile
VBox
javafx.scene.shape
Shape
Arc
Circle
CubicCurve
Ellipse
Line
Path
Polygon
QuadCurve
Rectangle
ShapeIntersect
ShapeSubtract
SVGPath
javafx.scene.text
Text
javafx.scene.control
Region
Button
ButtonBase
Cell
CheckBox
ChoiceBox
Hyperlink
IndexedCell
Label
Labeled
ListCell
ListView
PasswordBox
http://docs.oracle.com/cd/E17802_01/javafx/javafx/1.3/docs/api/javafx.scene/doc-les/cssref.html 1/25
03/11/2016 JavaFX CSS Reference Guide
ProgressBar
ProgressIndicator
RadioButton
ScrollBar
ScrollView
Separator
Skin
Slider
TextBox
TextInputControl
ToggleButton
Tooltip
javafx.scene.chart
AreaChart
BarChart
BarChart3D
BubbleChart
Chart
LineChart
PieChart
PieChart3D
ScatterChart
XYChart
javafx.scene.chart.part
Axis
CategoryAxis
Legend
NumberAxis
PlotSymbol
ValueAxis
com.javafx.preview.control
CheckMenuItem
Menu
MenuBar
MenuButton
MenuItemBase
PopupMenu
RadioMenuItem
SplitMenuButton
ToolBar
TreeCell
TreeView
References
Introduction
JavaFXCascadingStyleSheets(CSS)isbasedontheW3CCSSversion2.1[1]withsomeadditionsfromcurrentworkonversion
3[2].JavaFXCSSalsohassomeextensionstoCSSinsupportofspecificJavaFXfeatures.ThegoalforJavaFXCSSistoallow
webdevelopersalreadyfamiliarwithCSSforHTMLtouseCSStocustomizeanddevelopthemesforJavaFXcontrolsandscene
graphobjectsinanaturalway.TheJavaFXCSSsupportandextensionshavebeendesignedtoallowJavaFXCSSstylesheetsto
beparsedcleanlybyanycompliantCSSparser,eventhoughitmightnotsupportJavaFXextensions.Thisenablesthemixingof
CSSstylesforJavaFXandforotherpurposes(suchasforHTMLpages)intoasinglestylesheet.Tothisend,allJavaFXproperty
nameshavebeenprefixedwithavendorextensionof"fx".EvenpropertiesthatmightseemtobecompatiblewithstandardHTML
CSShavebeenprefixed,becauseJavaFXhassomewhatdifferentsemanticsfortheirvalues.
JavaFXCSSdoesnotsupportCSSlayoutpropertiessuchasfloat,position,overflow,andwidth.However,theCSSpaddingand
marginspropertiesaresupportedonsomeJavaFXscenegraphobjects.Allotheraspectsoflayoutarehandledprogrammaticallyin
JavaFXScriptcode.Inaddition,CSSsupportforHTMLspecificelementssuchasTablesarenotsupportedsincethereisno
equivalentconstructinJavaFX.
JavaFXhasarichsetofextensionstoCSSinsupportoffeaturessuchascolorderivation,propertylookup,andmultiple
backgroundcolorsandbordersforasinglenode.Thesefeaturesaddsignificantnewpowerfordevelopersanddesignersandare
describedindetailinthisdocument.
Thestructureofthisdocumentisasfollows.First,thereisadescriptionofallvaluetypesforJavaFXCSSproperties.Where
appropriate,thisincludesagrammarforthesyntaxofvaluesofthattype.Then,foreachscenegraphnodethatsupportsCSS
styles,atableisgiventhatliststhepropertiesthataresupported,alongwithtypeandsemanticinformation.Thepseudoclassesfor
eachclassarealsogiven.ThedescriptionofCSSpropertiescontinuesforthecontrols.Foreachcontrol,thesubstructureofthat
control'sskinisgiven,alongwiththestyleclassnamesfortheRegionobjectsthatimplementthatsubstructure.
http://docs.oracle.com/cd/E17802_01/javafx/javafx/1.3/docs/api/javafx.scene/doc-les/cssref.html 2/25
03/11/2016 JavaFX CSS Reference Guide
CSSandtheJavaFXSceneGraph
CSSstylesareappliedtonodesintheJavaFXscenegraphinawaysimilartothewayCSSstylesareappliedtoelementsinthe
HTMLDOM.
CSSstylesareloadedfromseveralsources.Thereisadefaultstylesheetbuiltintothesystem.Stylesheetsarealsoloadedfrom
theURLsspecifiedinthestyleSheetsvariableoftheSceneobject.RulesloadedfromaScene'sstylesheetstakeprecedence
overrulesfromthebuiltinstylesheet.Finally,eachnodehasastylevariablethatcancontainstyledeclarations.(Thisis
analogoustothestyle="..."attributethatcanappearonHTMLelements.)Declarationsspecifedheretakeprecedenceoverrules
originatingelsewhere.Theprecedenceorderofstylerulescanbemodifiedusing"!important"inastyledeclaration.
EachnodeinthescenegraphhasastyleClassvariable,astring.Thisisanalogoustotheclass="..."attributethatcanappearon
HTMLelements.Supplyingastringforanode'sstyleClassvariablecausesstylepropertiesforthatstyleclasstoappliedtothis
node.Stylesforstyleclassescanbespecifiedusingthe".styleclass"selectorsyntaxinastylesheet.
Eachnodeinthescenegraphhasanidvariable,astring.Thisisanalogoustotheid="..."attributethatcanappearHTMLelements.
Supplyingastringforanode'sidvariablecausesstylepropertiesforthisnodetobelookedupusingthatid.Stylesforspecificids
canbespecifiedusingthe"#nodeid"selectorsyntaxinastylesheet.
Eachnodehonorsasetofpropertiesthatdependsonthenode'sJavaFXclass(asdistinctfromitsstyleClass).Theproperties
honoredbyeachnodeclassareshownindetailintableslaterinthisdocument.Thepropertyvaluethatisactuallyapplieddepends
ontheprecedenceoftheoriginoftherule,asdescribedabove,aswellasthespecificityoftherule'sselectorasdescribedinCSS
2.Ultimately,apropertyvaluestringisconvertedintoaJavaFXvalueoftheappropriatetypeandisthenassignedtoaninstance
variableoftheJavaFXobject.
CSSstylesareappliedasynchronously.Thatis,CSSstylesareloadedandvaluesareconvertedandassignedsometimeaftera
scenegraphobjecthasbeencreatedandaddedtothescenegraph,butbeforethescenegraphisfirstlaidoutandpainted.In
addition,ifthestylesthatapplytoanobjecthavechanged(forexample,becauseitspseudoclasshaschanged),valuesfromthe
newlyappliedstyleswillnotbeappliedimmediately.Instead,theywillbeappliedsometimeaftertheobject'sstatehaschangedbut
beforethesceneisnextpainted.
TheapplicationofCSSstylesaffectsthevaluesofJavaFXobjects'variables.Inmanycases,JavaFXScriptprogramscanwriteto
thesevariablesiftheyarepublic.ThisraisesthepossibilitythatCSSmightoverwritevaluesthathadbeeninitializedorassignedby
aJavaFXScriptprogram.SinceCSSstylesareappliedasynchronously,it'spossiblethatvaluesmightbeassignedbyaprogram
andusedforsometimebeforebeingoverwrittenbyCSSatanarbitrarytimelater.Toavoidproblemslikethis,theCSS
implementationappliesthefollowingpolicytosomeofthemorecommonvariablesthataresetbyCSSstyleproperties.Thepolicy
is:ifatanypointaJavaFXScriptprogrameverwritestoavariableofanobject,thatvariableishenceforthneverwrittenbyCSS,
evenifithadbeensetbyCSSinthepast.ThisallowsJavaFXScriptprogrammerstoinitializevariablesinobjectliterals,andto
assigntoobjects'variables,withoutfearofthosevaluesbeingoverwrittenbyCSS.However,it'sprobablybesttoavoidsetting
variablesbothprogramaticallycodeandfromCSS.Withcontrolsandcharts,settingvaluesfromCSSispreferable.
ThispolicyappliestothefollowingJavaFXvariables:
Label.textFill
Labeled.font
Labeled.graphicVPos
Labeled.vpos
Node.cursor
Node.effect
Node.opacity
PasswordBox.echoChar
Text.font
TextInputControl.font
NamingconventionshavebeenestablishedforderivingCSSstyleclassnamesfromJavaFXclassnames,andforderivingCSS
propertynamesfromJavaFXvariablenames.Notethatthisisonlyanamingconventionthereisnoautomaticnameconversion.
MostJavaFXnamesuse"camelcase,"thatis,mixedcasenamesformedfromcompoundwords,wheretheinitialletterofeach
subwordiscapitalized.MostCSSnamesintheHTMLworldarealllowercase,withcompoundwordsseparatedbyhyphens.The
conventionisthereforetotakeJavaFXclassnamesandformtheircorrespondingCSSstyleclassnamebyseparatingthe
compoundwordswithhyphensandconveringtheletterstoalllowercase.Forexample,theJavaFXToggleButtonclasswouldhave
astyleclassof"togglebutton".TheconventionformappingJavaFXvariablenamestoCSSpropertynamesissimilar,withthe
additionofthe"fx"prefix.Forexample,theblendModevariablewouldhaveacorrespondingCSSpropertynameof"fxblend
mode".
Limitations
Usingaclassselectorasadescendantselector(usingwhitespaceasthecombinator)doesnotwork.Instead,inserta*priortothe
classselector.Forexample,insteadof".a.b{...}"use".a*.b{...}".
The":firstchild"and":lang"pseudoclassesarenotsupported.The":firstline",":firstletter",":after",and":before"pseudoelements
arenotsupported.
The":active"and":focus"dynamicpseudoclassesarenotsupported.However,Nodesdosupportthe":pressed"and":focused"
pseudoclasses,whicharesimilar.
http://docs.oracle.com/cd/E17802_01/javafx/javafx/1.3/docs/api/javafx.scene/doc-les/cssref.html 3/25
03/11/2016 JavaFX CSS Reference Guide
The":link"and":visited"pseudoclassesarenotsupportedingeneral.However,Hyperlinkobjectscanbestyled,andtheysupport
the":visited"pseudoclass.
Itispossibletospecifyonlyonestyleclassforanode.ThisisincontrasttoCSSforHTML,whereanHTMLelementcanhave
morethanonestyleclass.Thisissignificantforthefollowingreason.Eachcontrolhasadefaultstyleclassvalueswhichmatchesa
setofrulesinthedefaultstylesheet.Thisishowthedefaultvisualstyleisachieved.Ifyouchangethestyleclassofacontrol,the
defaultstyleswon'tbeapplied.Thisisanadvantageifyouwanttohaveacompletelydifferentstyleforthecontrol,butit'sa
disadvantageifyouwanttousethedefaultstyleandonlychangeoneortwoproperties.Ifyouwanttodothelatter,aworkaround
wouldbetosetanidvalueonthecontrolandtowritesomestylerulesthatapplytonodeswiththatid(usingthe"#nodeid"selector
syntax).
JavaFXCSSdoesnotsupportcommaseparatedseriesoffontfamilynamesinthefxfontfamilyproperty.Theoptionallineheight
parameterwhenspecifyingfontsisnotsupported.Thereisnoequivalentforthefontvariantproperty.
JavaFXCSSusestheHSBcolormodelinsteadoftheHSLcolormodel.
A<uri>isnotsupportedasavalueforthefxcursorproperty.
ItispossibletousetheJavaFXclassnameasatypeselector,however,suchuseisnotrecommended.Forexample,itispossible
tospecifystylesforaToggleButtonusingthesyntax"ToggleButton{...}".Suchusageisnotrecommendedbecausethenameused
tomatchthetypeselectoristheactualconcreteclassnameusedintheJavaFXprogram.Thisclassnamecanchangeinthecase
ofsubclassing.IftheapplicationweretosubclasstheToggleButtonclass,thesestyleswouldnolongerapply.Inaddition,ifa
variableorfunctionisoverriddeninaToggleButtonobjectliteral,orifavariableisinitializedusingbindinanobjectliteral,the
currentJavaFXScriptcompilerimplementationsilentlycreatesananonymoussubclassofToggleButton.TheToggleButtonstyles
wouldnolongerapplytothisobject.Forthisreason,styleclassnameshavebeenprovidedforallJavaFXscenegraphclasses,
anduseofthestyleclassnamesinstylesheetsispreferred.
AtthistimemostoftheUIcontrolsintheJavaFXruntimearebuiltusingRegions,whichareinternalimplementationobjectsthat
provideCSSsupportforarichsetofCSSstyleproperties.Thesestylepropertiesaredescribedbelow.However,theactualRegion
objectsandthustheirstatevariablesareconsideredinternaltothesystemandarenotdirectlyaccessibletoapplications.
Atthistime,theprogramminginterfacesnecessaryforaclasstodeclaresupportforCSSproperties,toconvertandloadthese
valuesfromCSSstylesheetsintoobjectvariables,andtodeclareandnotifychangestoanobject'spseudoclasses,areconsidered
internalinterfacesandarenotaccessibledirectlytoapplications.
Inheritance
CSSalsoprovidesforcertainpropertiestobeinheritedbydefault,ortobeinheritedifthepropertyvalueis'inherit'.Ifavalueis
inherited,itisinheritedfromthecomputedvalueoftheelement'sparentinthedocumenttree.InJavaFX,inheritanceissimilar,
exceptthatinsteadofelementsinthedocumenttree,inheritanceoccursfromparentnodesinthescenegraph.
ThereisalsoahierarchyofJavaFXclasses:forexample,RectangleisasubclassofShape,whichinturnisasubclassofNode.A
differentsortofinheritanceoccurshere.AJavaFXsubclasswill"inherit"CSSpropertiesfromitsJavaFXsuperclass,similartothe
wayvariablesandfunctionsareinherited.Thatis,asubclasswillgenerallyrespondtothesamesetofpropertiesasitsancestor
classes,andpossiblytoadditionalpropertiesitdefinesitself.Notethatthepropertiessupportedarewhatisinherited,butnotthe
actualpropertyvalues.So,aShapesupportsallthepropertiesofNodeplusseveralmore,andRectanglesupportsallthe
propertiesofShapeplusacouplemore.However,providingstyledeclarationsforaShapewillnotcauseaRectangletousethose
values.
Examples
ConsiderthefollowingsimpleJavaFXScriptapplication:
Scene {
width: 200 height: 200
stylesheets: [ "{__DIR__}test.css" ]
content: Rectangle {
x: 50 y: 50 width: 100 height: 100
styleClass: "my-rect"
}
}
Withoutanystyles,thiswilldisplayaplainblackrectangle.Iftest.csscontainsthefollowing:
.my-rect {
-fx-fill: red;
}
therectanglewillberedinsteadofblack:
http://docs.oracle.com/cd/E17802_01/javafx/javafx/1.3/docs/api/javafx.scene/doc-les/cssref.html 4/25
03/11/2016 JavaFX CSS Reference Guide
Iftest.csscontainsthefollowing:
.my-rect {
-fx-fill: yellow;
-fx-stroke: green;
-fx-stroke-width: 5;
-fx-stroke-dash-array: 12 2 4 2;
-fx-stroke-dash-offset: 6;
-fx-stroke-line-cap: butt;
}
theresultwillbeayellowrectanglewithanicelydashedgreenborder:
Types
inherit
Eachpropertyhasatype,whichdetermineswhatkindofvalueandthesyntaxforspecifingthosevalues.Inaddition,eachproperty
mayhaveaspecifiedvalueof'inherit',whichmeansthat,foragivennode,thepropertytakesthesamecomputedvalueasthe
propertyforthenode'sparent.The'inherit'valuecanbeusedonpropertiesthatarenotnormallyinherited.
Ifthe'inherit'valueissetontherootelement,thepropertyisassigneditsinitialvalue.
<boolean>
Booleanvaluescaneitherhavethestringvalueof"true"or"false",thevaluesarecaseinsensitiveasallCSSiscaseinsensitive.
<number>&<integer>
Somevaluetypesmayhaveintegervalues(denotedby<integer>)orrealnumbervalues(denotedby<number>).Realnumbers
andintegersarespecifiedindecimalnotationonly.An<integer>consistsofoneormoredigits"0"to"9".A<number>caneitherbe
an<integer>,oritcanbezeroormoredigitsfollowedbyadot(.)followedbyoneormoredigits.Bothintegersandrealnumbers
maybeprecededbya""or"+"toindicatethesign.0isequivalentto0andisnotanegativenumber.
Notethatmanypropertiesthatallowanintegerorrealnumberasavalueactuallyrestrictthevaluetosomerange,oftentoanon
negativevalue.
<string>
Stringscaneitherbewrittenwithdoublequotesorwithsinglequotes.Doublequotescannotoccurinsidedoublequotes,unless
escaped(e.g.,as'\"'oras'\22').Analogouslyforsinglequotes(e.g.,"\'"or"\27").
"this is a 'string'"
"this is a \"string\""
'this is a "string"'
'this is a \'string\''
Astringcannotdirectlycontainanewline.Toincludeanewlineinastring,useanescaperepresentingthelinefeedcharacterin
ISO10646(U+000A),suchas"\A"or"\00000a".Thischaracterrepresentsthegenericnotionof"newline"inCSS.Seethe'content'
propertyforanexample.
http://docs.oracle.com/cd/E17802_01/javafx/javafx/1.3/docs/api/javafx.scene/doc-les/cssref.html 5/25
03/11/2016 JavaFX CSS Reference Guide
Itispossibletobreakstringsoverseverallines,foraestheticorotherreasons,butinsuchacasethenewlineitselfhastobe
escapedwithabackslash(\).Forinstance,thefollowingtwoselectorsareexactlythesame:
a[title="a not s\
o very long title"] { /*...*/ }
a[title="a not so very long title"] { /*...*/ }
<size>
<number> [ % | px | mm | cm | in | pt | pc | em | ex ]?
Nowhitespaceisallowedbetweenthenumberandunitsifprovided.
Sizescaneitherbeapercentageoralengthwithunits.Ifunitsarenotspecifiedthenspecifiedthe'px'isassumed.Someunitsare
relativeandothersabsolute.
Relative
px:pixels,relativetotheviewingdevice
em:the'fontsize'oftherelevantfont
ex:the'xheight'oftherelevantfont
Absolute
in:inches1inchisequalto2.54centimeters.
cm:centimeters
mm:millimeters
pt:pointsthepointsusedbyCSS2.1areequalto1/72ndofaninch.
pc:picas1picaisequalto12points.
Percentages
Theseareapercentageofsomelength,theyarecontextsensitivesowhattheyarerelativetodependsonwheretheyare
specified.Eachpropertythatsupportsapercentageshouldspecifyifpercentageissupportedandifitiswhatitisrelativeto.
<uri>
<address>canbeanabsoluteURI,forexample:
url(http://example.com)
url('http://example.com')
url("http://example.com")
oritcanberelativetothelocationoftheCSSfile.
<effect>
JavaFXCSScurrentlysupportstheDropShadowandInnerShadoweffectsfromtheJavaFXplatform.Seetheclassdocumentation
injavafx.scene.effectforfurtherdetailsaboutthesemanticsofthevariouseffectparameters.
DropShadow
Ahighleveleffectthatrendersashadowofthegivencontentbehindthecontent.
InnerShadow
Ahighleveleffectthatrendersashadowinsidetheedgesofthegivencontent.
http://docs.oracle.com/cd/E17802_01/javafx/javafx/1.3/docs/api/javafx.scene/doc-les/cssref.html 6/25
03/11/2016 JavaFX CSS Reference Guide
<c olor>TheshadowColor.
CSSProperty Values Default Comments
<number>Theradiusoftheshadowblurkernel.Intherange[0.0...127.0],typicalvalue10.
<number>Thechokeoftheshadow.Thechokeistheportionoftheradiuswherethecontributionofthesourcematerialwillbe
100%.Theremainingportionoftheradiuswillhaveacontributioncontrolledbytheblurkernel.Achokeof0.0willresultina
distributionoftheshadowdeterminedentirelybythebluralgorithm.Achokeof1.0willresultinasolidgrowthinwardoftheshadow
fromtheedgestothelimitoftheradiuswithaverysharpcutofftotransparencyinsidetheradius.Valuesshouldbeintherange[0.0
...1.0].
<number>Theshadowoffsetinthexdirection,inpixels.
<number>Theshadowoffsetintheydirection,inpixels.
<font>
JavaFXCSSsupportstheabilitytospecifyfontsusingseparatefamily,size,style,andweightproperties,aswellastheabilityto
specifyafontusingasingleshorthandproperty.Therearefourvaluetypesrelatedtofontsplusashorthandpropertythat
encompassesallfourproperties.Thefontrelatedtypesareasfollows.
<font-family>Thestringnameofthefontfamily.Anactualfontfamilynameavailableonthesystemcanbeused,oroneofthe
followinggenericfamilynamescanbeused:
'serif'(e.g.,Times)
'sansserif'(e.g.,Helvetica)
'cursive'(e.g.,ZapfChancery)
'fantasy'(e.g.,Western)
'monospace'(e.g.,Courier)
<font-size>Thesizeofthefont,usingthe<size>syntax.
<font-style>Thefont'sstyle,usingthefollowingsyntax:
[ normal | italic | oblique ]
<font-weight>Thefont'sweight,usingthefollowingsyntax:
[ normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 ]
<font>Thisfontshorthandpropertycanbeusedinplaceoftheaboveproperties.Itusesthefollowingsyntax:
[[ <font-style> || <font-weight> ]? <font-size> <font-family> ]
FontProperties
Mostclassesthatusetextwillsupportthefollowingfontproperties.Insomecasesasimilarsetofpropertieswillbesupportedbut
withadifferentprefixinsteadof"fxfont".
<paint>
Paintvaluescaneitherbeasolidcolorspecifiedinoneofthecolorsyntaxesortheycanbealinearorradialgradient.
LinearGradients<lineargradient>
linear ( <size> , <size> ) to ( <size> , <size> ) stops [ ( <number> , <color> ) ]+ [ repeat |
reflect ]?
Lineargradientcreatesagradientgoingthoughallthestopcolorsalongthelinebetweenthetwopointsspecifiedbythefirstand
second(<size>,<size>).Ifthesizesarepercentagesthentheyarerelativetothesizeoftheareabeingfilled.Percentageand
lengthsizescannotbemixedinasinglegradientdefinition.Thisexamplewillcreateagradientfromtoplefttobottomrightofthe
filledareawithredatthetopleftcornerandblackatthebottomright.
Thismorecomplexexamplewillcreatea50pxhighbaratthetopwitha3colorgradientwithwhiteunderneathfortherestofthe
filledarea.
RadialGradients<radialgradient>
http://docs.oracle.com/cd/E17802_01/javafx/javafx/1.3/docs/api/javafx.scene/doc-les/cssref.html 7/25
03/11/2016 JavaFX CSS Reference Guide
radial [ ( <size> , <size> ) , ]? <size> [ focus ( <size> , <size> ) ] ? stops [ ( <number> ,
<color> ) ]+ [ repeat | reflect ]?
Thefirstpoint(size,size)isthecenterofthegradient,ifnotspecifiedthisisassumedtobethecenter.Thenext<size>isthe
radiuswhichisfollowedbyaoptionalfocuspoint.Hereareasimpleandmorecomplexexamples:
<color>
NamedColors<named-color>
CSSsupportsabunchofnamedconstantcolors.Namedcolorscanbespecifiedwithjusttheirunquotednameforexample:
.button {
-fx-background-color: red;
}
ThenamedcolorsthatareavailableinCSSare:
http://docs.oracle.com/cd/E17802_01/javafx/javafx/1.3/docs/api/javafx.scene/doc-les/cssref.html 8/25
03/11/2016 JavaFX CSS Reference Guide
LookedupColors<looked-up-color>
Withlookedupcolorsyoucanrefertoanyothercolorpropertythatissetonthecurrentnodeoranyofitsparents.Thisisavery
powerfulfeature,asitallowsagenericpaletteofcolorstobespecifiedonthescenethenusedthoughouttheapplication.Ifyou
wanttochangeoneofthosepalettecolorsyoucandosoatanylevelinthescenetreeanditwillaffectthatnodeandallits
decendents.Lookedupcolorsarenotlookedupuntiltheyareapplied,sotheyareliveandreacttoanystylechangesthatmight
occur,suchasreplacingapalettecoloratruntimewiththe"style"propertyonanode.
Inthefollowingexample,allbackgroundcolorofallbuttonsusesthelookedupcolor"abc".
RGBColors<rgb-color>
TheRGBcolormodelisusedinnumericalcolorspecifications.Ithasanumberofdifferentsupportedforms.
Theseexamplesallspecifythesamecolor:
RGBHex:TheformatofanRGBvalueinhexadecimalnotationisa#immediatelyfollowedbyeitherthreeorsixhexadecimal
characters.ThethreedigitRGBnotation(#rgb)isconvertedintosixdigitform(#rrggbb)byreplicatingdigits,notbyaddingzeros.
Forexample,#fb0expandsto#ffbb00.Thisensuresthatwhite(#ffffff)canbespecifiedwiththeshortnotation(#fff)andremoves
anydependenciesonthecolordepthofthedisplay.
RGBDecimalorPercent:TheformatofanRGBvalueinthefunctionalnotationisrgb(followedbyacommaseparatedlistof
threenumericalvalues(eitherthreedecimalintegervaluesorthreepercentagevalues)followedby).Theintegervalue255
correspondsto100%,andtoForFFinthehexadecimalnotation:rgb(255,255,255)=rgb(100%,100%,100%)=#FFF.Whitespace
charactersareallowedaroundthenumericalvalues.
RGB+Alpha:ThisisanextensionoftheRGBcolormodeltoincludeanalphavaluethatspecifiestheopacityofacolor.Thisis
accomplishedviaafunctionalsyntaxoftheformrgba(...)formthattakesafourthparameterwhichisthealphavalue.Thealpha
http://docs.oracle.com/cd/E17802_01/javafx/javafx/1.3/docs/api/javafx.scene/doc-les/cssref.html 9/25
03/11/2016 JavaFX CSS Reference Guide
valuemustbeanumberintherange0.0(representingcompletelytransparent)and1.0(completelyopaque).Aswiththergb()
CSSProperty Values Default Range Comments
function,thered,green,andbluevaluesmaybedecimalintegersorpercentages.Thefollowingexamplesallspecifythesame
color:
HSBColors<hsb-color>
ColorscanbespecifiedusingtheHSB(sometimescalledHSV)colormodel,asfollows:
Thefirstnumberishue,anumberintherange0to360degrees.Thesecondnumberissaturation,apercentageintherange0%to
100%.Thethirdnumberisbrightness,alsoapercentageintherange0%to100%.Thehsba(...)formtakesafourthparameterat
theendwhichisaalphavalueintherange0.0to1.0,specifyingcompletelytransparentandcompletelyopaque,respectively.
ColorFunctions<color-function>
JavaFXsupportssomecolorcomputationfunctions.Thesecomputenewcolorsfrominputcolorsatthetimethecolorstyleis
applied.Thisenablesacolorthemetobespecifiedusingasinglebasecolorandtohavevariantcolorscomputedfromthatbase
color.Therearetwocolorfunctions:derive()andladder().
<derive> | <ladder>
Derive<derive>
Thederivefunctiontakesacolorandcomputesabrighterordarkerversionofthatcolor.Thesecondparameteristhebrightness
offset,rangingfrom100%to100%.Positivepercentagesindicatebrightercolorsandnegativepercentagesindicatedarkercolors.
Avalueof100%meanscompletelyblack,0%meansnochangeinbrightness,and100%meanscompletelywhite.
Ladder <ladder>
Theladderfunctioninterpolatesbetweencolors.Theeffectisasifagradientiscreatedusingthestopsprovided,andthenthe
brightnessoftheprovided<color>isusedtolookupacolorvaluewithinthatgradient.At0%brightnessthecoloratthe0.0end
ofthegradientisusedat100%brightnessthecoloratthe1.0endofthegradientisusedandat50%brightnessthecolorat0.5,
themidwaypointofthegradient,isused.Notethatnogradientisactuallyrendered.Thisismerelyaninterpolationfunctionthat
resultsinasinglecolor.
Forexample,youcouldusethefollowingifyouwantthetextcolortobeblackorwhitedependinguponthebrightnessofthe
background.
background: white;
-fx-text-fill: ladder background stops (0.49, white) (0.5, black);
Theresultingfxtextfillvaluewillbeblack,becausethebackground(white)hasabrightnessof100%,andthecolorat1.0onthe
gradientisblack.Ifweweretochangethebackgroundcolortoblackordarkgrey,thebrightnesswouldbelessthan50%,givingan
fxtextfillvalueofwhite.
Nodes
javafx.scene
Node
CSSProperty Values Default Range Comments
[ null | crosshair | default | hand | move |
e-resize | h-resize | ne-resize | nw-resize
fxcursor | n-resize | se-resize | sw-resize | s-
null Notethat<uri>isnotcurrentlysupported.
resize | w-resize | v-resize | text | wait ]
fxeffect <effect> null
fxfocustraversable <boolean> false
http://docs.oracle.com/cd/E17802_01/javafx/javafx/1.3/docs/api/javafx.scene/doc-les/cssref.html 10/25
03/11/2016 JavaFX CSS Reference Guide
CSSPseudoclass
CSSProperty
CSSProperty
CSSProperty
CSSProperty
CSSProperty
CSSProperty
Values
Values
Default
ValuesDefault
Comments
Default
Comments
Comments
Comments
Values
Values Values
Default Default
Range Comments Comments Default Comments
Opacitycanbethoughtofconceptuallyasa
postprocessingoperation.Conceptually,afterthe
node(includingitsdescendants)isrenderedintoan
fxopacity <number> 1 [0.0 ... 1.0]
RGBAoffscreenimage,theopacitysettingspecifies
howtoblendtheoffscreenrenderingintothecurrent
compositerendering.
Thisistheangleoftherotationindegrees.Zero
degreesisat3o'clock(directlytotheright).Angle
fxrotate <number> 0
valuesarepositiveclockwise.Rotationisaboutthe
center.
fxscalex <number> 1 scaleaboutthecenter
fxscaley <number> 1 scaleaboutthecenter
fxscalez <number> 1 scaleaboutthecenter
fxtranslatex <number> 0
fxtranslatey <number> 0
fxtranslatez <number> 0
Pseudoclasses
CSSPseudoclass Comments
disabled applieswhenthedisabledvariableistrue
focused applieswhenthefocusedvariableistrue
hover applieswhenthehovervariableistrue
pressed applieswhenthepressedvariableistrue
Group
CSSProperty Values Default Comments
[ add | blue | color-burn | color-dodge | darken | difference | exclusion | green | hard-light |
fxblendmode lighten | multiply | overlay | red | screen | soft-light | src-atop | src-in | src-out | src-over ]
null
AlsohasallpropertiesofNode
Scene
Styleclass:scene
TheSceneobjecthasnosettableCSSproperties,nordoesithaveanypseudoclasses.However,itdoeshaveastyleclass.Thisis
usefulbecauseaSceneistherootcontainerforallactivescenegraphnodes.Thus,itcanserveasacontainerforpropertiesthat
areinheritedorlookedup,eventhoughitdoesn'thaveanysettablepropertiesofitsown.
javafx.scene.image
ImageView
CSSProperty Values Default Comments
fximage <uri> null
AlsohasallpropertiesofNode
javafx.scene.layout
ClipView
CSSProperty Values Default Comments
fxpannable <boolean> true
AlsohasallpropertiesofNode
Container
CSSProperty Values Default Comments
fxsnaptopixel <boolean> false
AlsohasallpropertiesofNode
Flow
CSSProperty Values Default Comments
fxhgap <size> 0
fxhpos [ left | center | right | leading | trailing ] left
fxnodehpos [ left | center | right | leading | trailing ] center
fxnodevpos [ top | center | baseline | bottom | page-end | page-start ] center
fxvertical <boolean> false
http://docs.oracle.com/cd/E17802_01/javafx/javafx/1.3/docs/api/javafx.scene/doc-les/cssref.html 11/25
03/11/2016 JavaFX CSS Reference Guide
CSSProperty
CSSProperty Values Values
Values Default Comments Default
Default
Default Comments
Comments
Range Comments Comments
fxvgap <number> 0
fxvpos [ top | center | baseline | bottom | page-end | page-start ] top
AlsohasallpropertiesofContainer&Node
HBox
CSSProperty Values Default Comments
fxhpos [ left | center | right | leading | trailing ] left
fxnodevpos [ top | center | baseline | bottom | page-end | page-start ] center
fxspacing <size> 0
fxvpos [ top | center | baseline | bottom | page-end | page-start ] top
AlsohasallpropertiesofContainer&Node
Stack
CSSProperty Values Default Comments
fxnodehpos [ left | center | right | leading | trailing ] center
[ top | center | baseline | bottom | page-end | page-
fxnodevpos start ] center
Thespacingbetweenthesideofthestackanditscontent
fxpadding <size> | <size> <size> <size> <size> 0
"children"
AlsohasallpropertiesofContainer&Node
Tile
CSSProperty Values Default Range Comments
fxcolumns <integer> 5 >0
fxhgap <size> 0
fxhpos [ left | center | right | leading | trailing ] left
fxnodehpos [ left | center | right | leading | trailing ] center
fxnodevpos [ top | center | baseline | bottom | page-end | page-start ] center
fxrows <integer> 5 >0
fxtileheight <number> 0 >0
fxtilewidth <number> 0 >0
fxvertical <boolean> false
fxvgap <size> 0
fxvpos [ top | center | baseline | bottom | page-end | page-start ] top
AlsohasallpropertiesofContainer&Node
VBox
CSSProperty Values Default Comments
fxhpos [ left | center | right | leading | trailing ] left
fxnodehpos [ left | center | right | leading | trailing ] center
fxspacing <size> 0
fxvpos [ top | center | baseline | bottom | page-end | page-start ] top
AlsohasallpropertiesofContainer&Node
javafx.scene.shape
Shape
CSSProperty Values Default Comments
fxfill <paint> BLACK
fxsmooth <boolean> true
fxstroke <paint> null
fxstrokedasharray <size>( <size>)+ null
fxstrokedashoffset <number> 0
fxstrokelinecap [ square | butt | round ] square
fxstrokelinejoin [ miter | bevel | round ] miter
fxstrokemiterlimit <number> 10
fxstrokewidth <size> 1
AlsohasallpropertiesofNode
Arc
TheArcnodehasallthepropertiesofShapeandNode.
http://docs.oracle.com/cd/E17802_01/javafx/javafx/1.3/docs/api/javafx.scene/doc-les/cssref.html 12/25
03/11/2016 JavaFX CSS Reference Guide
Circle
CSSProperty
CSSProperty Values Default Comments
Values Default Comments
TheCirclenodehasallthepropertiesofShapeandNode.
CubicCurve
TheCubicCurvenodehasallthepropertiesofShapeandNode.
Ellipse
TheEllipsenodehasallthepropertiesofShapeandNode.
Line
TheLinenodehasallthepropertiesofShapeandNode.
Path
ThePathnodehasallthepropertiesofShapeandNode.
Polygon
ThePolygonnodehasallthepropertiesofShapeandNode.
QuadCurve
TheQuadCurvenodehasallthepropertiesofShapeandNode.
Rectangle
CSSProperty Values Default Comments
fxarcheight <size> 0
fxarcwidth <size> 0
AlsohasallpropertiesofShape&Node
ShapeIntersect
TheShapeIntersectnodehasallthepropertiesofShapeandNode.
ShapeSubtract
TheShapeSubtractnodehasallthepropertiesofShapeandNode.
SVGPath
TheSVGPathnodehasallthepropertiesofShapeandNode.
javafx.scene.text
Text
CSSProperty Values Default Comments
fxstrikethrough <boolean> false
fxtextalignment [ left | center | right | justify ] left
fxtextorigin [ baseline | top | bottom ] baseline
fxunderline <boolean> false
AlsohasfontpropertiesandallpropertiesofShape&Node
javafx.scene.control
InJavaFX1.3thedefaultskinsforallcontrolssupportstylingfromCSS.Thisisaccomplishedbybuildingtheskinsfrominternal
implementationobjectscalledRegions.MostofthestylepropertiesforacontrolactuallyareprovidedbytheRegionobjectsthat
comprisethecontrol'sskin.EachRegionobjectoftheskin'ssubstructurehasitsownstyleclasssothatitcanbestyledspecifically.
ThecontrolitselfwillsometimesprovideCSSpropertiesinadditiontothoseprovidedbyitsRegions.Finally,controlsmayalso
definepseudoclassessuchas"vertical"and"horizontal"inadditiontothosedefinedbyNode.
Region
ARegionisaContainerthathasbackgroundsandbordersthatarestyleableviaCSS.RegionscancontainotherRegionobjects
(subregions)ortheycancontainsubcontrols.ARegionistypicallyaroundedrectangle,thoughthiscanbemodifiedthroughCSS
tobeanarbitraryshape.AllRegionshavethesamesetofCSSpropertiesasdescribedbelow.
http://docs.oracle.com/cd/E17802_01/javafx/javafx/1.3/docs/api/javafx.scene/doc-les/cssref.html 13/25
03/11/2016 JavaFX CSS Reference Guide
EachRegionconsistsofseverallayers,paintedfrombottomtotop,inthisorder:
CSSProperty Values Default Comments
1.backgroundfills
2.backgroundimages
3.contents
4.borderstrokes
5.borderimages
ThebackgroundandbordermechanismsarepatternedaftertheCSS3draftbackgroundsandbordersmodule.See[4]fora
detaileddescription.
Backgroundfillsarespecifiedwiththepropertiesfxbackgroundcolor,fxbackgroundradiusandfxbackgroundinsets.The
fxbackgroundcolorpropertyisaseriesofoneormorecommaseparated<paint>values.Thenumberofvaluesintheseries
determinesthenumberofbackgroundrectanglesthatarepainted.Backgroundrectanglesarepaintedintheorderspecifiedusing
thegiven<paint>value.Eachbackgroundrectanglecanhavedifferentradiiandinsets.Thefxbackgroundradiusandfx
backgroundinsetspropertiesareseriesofcommaseparatedvalues(orsetsofvalues).Theradiusandinsetsvaluesusedfora
particularbackgroundarethefoundinthecorrespondingpositioninthefxbackgroundradiusandfxbackgroundinsetsseries.
Forexample,supposeaseriesofthreevaluesisgivenforthefxbackgroundcolorproperty.Aseriesofthreevaluesshouldalso
bespecifiedforthefxbackgroundradiusandfxbackgroundinsetsproperties.Thefirstbackgroundwillbepaintedusingthefirst
radiusvalueandfirstinsetsvalue,thesecondbackgroundwillbepaintedwiththesecondradiusvalueandsecondinsetsvalue,
andsoforth.
Notealsothatpropertiessuchasfxbackgroundradiusandfxbackgroundinsetscancontainaseriesofvaluesorsetsoffour
values.Asetofvaluesisseparatedbywhitespace,whereasthevaluesorsetsofvaluesinaseriesareseparatedbycommas.For
fxbackgroundradius,asinglevalueindicatesthatthevalueshouldbeusedfortheradiusofallfourcornersofthebackground
rectangle.Asetoffourvaluesindicatesthatdifferentradiusvaluesaretobeusedforthetopleft,topright,bottomright,and
bottomleftcorners,inthatorder.Similarly,thefxbackgroundinsetspropertycanalsocontainaseriesofvaluesorsetsofvalues.
Asetoffourvaluesforfxbackgroundinsetsindicatesthatdifferentinsetsaretobeusedforthetop,right,bottom,andleftedges
oftherectangle,inthatorder.
Backgroundimagesarespecifiedwiththepropertiesfxbackgroundimage,fxbackgroundimagerepeat,
fxbackgroundimagepositionandfxbackgroundimagesize.Thenumberofimagesintheseriesoffxbackgroundimage
valuesdeterminesthenumberofbackgroundimagesthatarepainted.Thefxbackgroundimagerepeat,fxbackgroundimage
position,andfxbackgroundimagesizepropertieseachcancontainaseriesofvalues.Foreachiteminthefxbackgroundimage
series,thecorrespondingitemsinthefxbackgroundimagerepeat,fxbackgroundimageposition,andfxbackgroundimagesize
propertiesareappliedtothatbackgroundimage.
Strokedbordersarespecifiedwiththepropertiesfxbordercolor,fxborderstyle,fxborderwidth,fxborderradiusand
fxborderinsets.Eachpropertycontainsaseriesofitems.Thenumberofitemsinthefxbordercolorpropertydeterminesthe
numberofbordersthatarepainted.Eachborderintheseriesispaintedusinginformationfromthecorrespondingseriesitemofthe
fxborderstyle,fxborderwidth,fxborderradius,andfxborderinsetsproperties.
Imagebordersarespecifiedwiththepropertiesfxborderimage,fxborderimagerepeat,fxborderimageslice,
fxborderimagewidthandfxborderimageinsets.Eachpropertycontainsaseriesofitems.Thenumberofitemsinthefx
borderimagepropertydeterminesthenumberofimagesthatarepainted.Eachimageintheseriesispaintedusinginformation
fromthecorrespondingseriesitemsofthefxborderimagerepeat,fxborderimageslice,fxborderimagewidth,andfxborder
imageinsetsproperties.
Theregion'scontentsareasequenceofnodes,likeanyothercontainer.Thecontentsaresetprogrammaticallyandcannotbeset
viaCSS.
http://docs.oracle.com/cd/E17802_01/javafx/javafx/1.3/docs/api/javafx.scene/doc-les/cssref.html 14/25
03/11/2016 JavaFX CSS Reference Guide
CSSProperty Values Default Comments
<bg-position> [ ,
<bg-position> ]*
where <bg-
position> = [
[ [ <size> |
left | center |
right ] [ <size> |
top | center | Aseriesof<bgposition>valuesseparatedbycommas.Eachbgpositioniteminthe
fxbackgroundimageposition null
bottom ]? ] seriesappliestothecorrespondingimageinthebackgroundimageseries.
| [ [ center |
[ left | right ]
<size>? ] || [
center | [ top |
bottom ] <size>? ]
]
<repeat-style> [ ,
<repeat-style> ]*
where <repeat-
style> = repeat-x Aseriesof<repeatstyle>valuesseparatedbycommas.Eachrepeatstyleiteminthe
fxbackgroundimagerepeat | repeat-y |
null
seriesappliestothecorrespondingimageinthebackgroundimageseries.
[repeat | space |
round | no-repeat]
{1,2}
<bg-size> [ , <bg-
size> ]*
<bg-size> = [ Aseriesof<bgsize>valuesseparatedbycommas.Eachbgsizeitemintheseries
fxbackgroundimagesize <size> | auto ]
null
appliestothecorrespondingimageinthebackgroundimageseries.
{1,2} | cover |
contain
STROKEDBORDERS
<paint> | <paint> Aseriesofpaintvaluesorsetsoffourpaintvalues,separatedbycommas.Foreach
<paint> <paint> itemintheseries,ifasinglepaintvalueisspecified,thenthatpaintisusedastheborder
<paint> [ ,
fxbordercolor [<paint> | <paint>
null forallsidesoftheregionandifasetoffourpaintsisspecified,theyareusedforthetop,
<paint> <paint> right,bottom,andleftbordersoftheregion,inthatorder.Iftheborderisnotrectangular,
<paint>] ]* onlythefirstpaintvalueinthesetisused.
<size> | <size> Aseriesofinsetorsetsoffourinsetvalues,separatedbycommas.Foreachiteminthe
<size> <size> series,asingleinsetvaluemeansthatallinsetsarethesameandifasetoffourinset
<size> [ , [
fxborderinsets <size> | <size>
null valuesisspecified,theyareusedforthetop,right,bottom,andleftedgesoftheregion,
<size> <size> inthatorder.Eachitemintheseriesofinsetsappliestothecorrespondingiteminthe
<size>] ]* seriesofbordercolors.
<size> | <size> Aseriesofradiusorsetsoffourradiusvalues,separatedbycommas.Foreachitemin
<size> <size> theseries,asingleradiusvaluemeansthatallcornerradiiarethesameandifasetof
<size> [ , [
fxborderradius <size> | <size>
null fourradiusvaluesisspecified,theyareusedastheradiiofthetopleft,topright,bottom
<size> <size> right,andbottomleftcorners,inthatorder.Eachitemintheseriesofradiiappliestothe
<size>] ]* correspondingitemintheseriesofbordercolors.
<border-style> [ ,
<border-style> ]*
where <border-
style> = <dash-
style> [centered |
inside | outside]?
[line-join [miter Aseriesofborderstylevalues,separatedbycommas.Eachitemintheseriesappliesto
fxborderstyle <number> | bevel |
null
thecorrespondingitemintheseriesofbordercolors.
round]]? [line-cap
[square | butt |
round]]?
where <dash-style>
= [ none | solid |
dotted | dashed ]
Aseriesofwidthorsetsoffourwidthvalues,separatedbycommas.Foreachiteminthe
<size> | <size>
<size> <size> series,asinglewidthvaluemeansthatallborderwidthsarethesameandifasetof
<size> [ , [ fourwidthvaluesisspecified,theyareusedforthetop,right,bottom,andleftborder
fxborderwidth <size> | <size>
null
widths,inthatorder.Iftheborderisnotrectangular,onlythefirstwidthvalueisused.
<size> <size>
Eachitemintheseriesofwidthsappliestothecorrespondingitemintheseriesofborder
<size>] ]*
colors.
IMAGEBORDERS
fxborderimage <uri> [ , <uri> ]* null AseriesofimageURIs,separatedbycommas.
<size> | <size> Aseriesofinsetorsetsoffourinsetvalues,separatedbycommas.Foreachiteminthe
<size> <size> series,asingleinsetvaluemeansthatallinsetsarethesameandifasetoffourinset
<size> [ , [
fxborderimageinsets <size> | <size>
null valuesisspecified,theyareusedforthetop,right,bottom,andleftedgesoftheregion,
<size> <size> inthatorder.Eachitemintheseriesofinsetsappliestothecorrespondingimageinthe
<size>] ]* seriesofborderimages.
<repeat-style> [ ,
<repeat-style> ]*
where <repeat-
style> = repeat-x Aseriesofrepeatstylevalues,separatedbycommas.Eachitemintheseriesappliesto
fxborderimagerepeat | repeat-y |
null
thecorrespondingimageintheseriesofborderimages.
[repeat | space |
round | no-repeat]
{1,2}
Aseriesofimageslicevaluesorsetsoffourvalues,separatedbycommas.Eachitemin
theseriesappliestothecorrespondingimageintheseriesofborderimages.Foreach
[<size> | <size> itemintheseries,iffourvaluesaregiven,theyspecifythesizeofthetop,right,bottom,
<size> <size> andleftslices.Thiseffectivelydividestheimageintonineregions:anupperleftcorner,a
<size> ] fill? [ ,
fxborderimageslice [ <size> | <size>
null topedge,anupperrightcorner,arightedge,alowerrightcorner,abottomedge,alower
<size> <size> leftcorner,aleftedgeandamiddle.Ifonevalueisspecified,thisvalueisusedforthe
<size> ] fill? ]* slicevaluesforallfouredges.If'fill'ispresent,themiddlesliceispreserved,otherwiseit
isdiscarded.Percentagevaluesmaybeusedhere,inwhichcasethevaluesare
consideredproportionaltothesourceimage.
http://docs.oracle.com/cd/E17802_01/javafx/javafx/1.3/docs/api/javafx.scene/doc-les/cssref.html 15/25
03/11/2016 JavaFX CSS Reference Guide
CSSPseudoclass
CSSProperty Comments
Comments
Comments
Values Default Comments
Aseriesofwidthorsetsoffourwidthvalues,separatedbycommas.Foreachiteminthe
<size> | <size> series,asinglewidthvaluemeansthatallborderwidthsarethesameandifasetof
<size> <size> fourwidthvaluesisspecified,theyareusedforthetop,right,bottom,andleftborder
<size> [ , [
fxborderimagewidth <size> | <size>
null widths,inthatorder.Iftheborderisnotrectangular,onlythefirstwidthvalueisused.
<size> <size> Eachitemintheseriesofwidthsappliestothecorrespondingitemintheseriesofborder
<size>] ]* images.Percentagevaluesmaybeusedhere,inwhichcasethevaluesareconsidered
proportionaltotheborderimagearea.
OTHER
Iftruemeanstheshapecenteredwithintheregion'swidthandheight,otherwisethe
fxpositionshape <boolean> true
shapeispositionedatitssourceposition.Hasnoeffectifashapestringisnotspecified.
Iftruemeanstheshapeisscaledtofitthesizeoftheregion,otherwisetheshapeisat
fxscaleshape <boolean> true itssourcesize,anditspositiondependsonthevalueofthepositionshapeproperty.Has
noeffectifashapestringisnotspecified.
AnSVGpathstring.Byspecifyingashapeheretheregiontakesonthatshapeinstead
fxshape "<string>" null
ofarectangleorroundedrectangle.Thesyntaxofthispathstringisspecifiedin[3].
AlsohasallpropertiesofStack,Container,andNode
Button
Styleclass:button
TheButtoncontrolhasallthepropertiesofRegion,LabeledandNode.
Pseudoclasses
CSSPseudoclass Comments
strong applieswhenthestrongvariableistrue
AlsohasallpseudoclassesofButtonBaseandNode
ButtonBase
TheButtonBasecontrolhasallthepropertiesofRegionandNode.
Pseudoclasses
CSSPseudoclass Comments
armed applieswhenthearmedvariableistrue
AlsohasallpseudoclassesofNode
Cell
Styleclass:cell
TheCellcontrolhasnoCSSsettableproperties.
Pseudoclasses
CSSPseudoclass Comments
empty applieswhentheemptyvariableistrue
filled applieswhentheemptyvariableisfalse
AlsohasallpseudoclassesofNode
CheckBox
Styleclass:checkbox
TheCheckBoxcontrolhasallthepropertiesofRegion,LabeledandNode.
Pseudoclasses
CSSPseudoclass Comments
defined applieswhenthedefinedvariableistrue
selected applieswhentheselectedvariableistrue
undefined applieswhenthedefinedvariableisfalse
AlsohasallpseudoclassesofNode
Substructure
boxaRegionrepresentinganemptybox
markaRegionrepresentingacheckmark,visiblewhenselected
labelaLabelcontrol
http://docs.oracle.com/cd/E17802_01/javafx/javafx/1.3/docs/api/javafx.scene/doc-les/cssref.html 16/25
03/11/2016 JavaFX CSS Reference Guide
ChoiceBox
CSSPseudoclass
CSSProperty
CSSProperty Values Default
Comments
Comments
Comments
Comments Values Default Comments
Styleclass:choicebox
TheChoiceBoxcontrolhasallthepropertiesofRegion,LabeledandNode.
Pseudoclasses
CSSPseudoclass Comments
showing applieswhentheshowingvariableistrue
AlsohasallpseudoclassesofNode
Substructure
displayaRegioncontainingthecurrentlydisplayedchoice
labelLabel
openbuttonRegion
arrowRegion
popupmenuPopupMenu
Hyperlink
Styleclass:hyperlink
TheHyperlinkcontrolhasallthepropertiesofRegion,LabeledandNode.
Pseudoclasses
CSSPseudoclass Comments
visited applieswhenthevisitedvariableistrue
AlsohasallpseudoclassesofNode
Substructure
labelLabel
IndexedCell
Styleclass:indexedcell
TheIndexedCellcontrolhasnoCSSsettableproperties.
Pseudoclasses
CSSPseudoclass Comments
even appliesifthiscell'sindexiseven
odd appliesifthiscell'sindexisodd
AlsohasallpseudoclassesofNode
Label
Styleclass:label
Labeled
CSSProperty Values Default Comments
fxgraphic <uri> null
fxgraphichpos [ left | center | right | leading | trailing ] left
fxgraphictextgap <size> 4
fxgraphicvpos [ top | center | baseline | bottom | page-end | page-start ] baseline
fxhpos [ left | center | right | leading | trailing ] left
fxtext <string> ""
textalignfromCSSspecmapsto
fxtextalignment [ left | center | right | justify ] left
textAlignmentinJavaFX
[ center-ellipses | center-word-ellipses | clip | ellipses | leading-
fxtextoverrun ellipses | leading-word-ellipses | word-ellipses ]
ellipses
fxtextwrap <boolean> false
fxvpos [ top | center | baseline | bottom | page-end | page-start ] baseline
http://docs.oracle.com/cd/E17802_01/javafx/javafx/1.3/docs/api/javafx.scene/doc-les/cssref.html 17/25
03/11/2016 JavaFX CSS Reference Guide
CSSPseudoclass
CSSProperty
CSSProperty
CSSPropertyValuesValues
Default
Comments
Comments
Default
Comments
Comments
Comments Values Default Comments
Alsohasfontproperties
ListCell
Styleclass:listcell
TheListCellcontrolhasnoCSSsettableproperties.
Pseudoclasses
CSSPseudoclass Comments
selected appliesifthisListCellisselected
AlsohasallpseudoclassesofIndexedCell&Node
ListView
Styleclass:listview
Pseudoclasses
CSSPseudoclass Comments
horizontal appliesifthisListViewishorizontal
vertical appliesifthisListViewisvertical
AlsohasallpseudoclassesofNode
PasswordBox
Styleclass:passwordbox
ProgressBar
Styleclass:progressbar
TheProgressBarcontrolhasallthepropertiesofRegionandNode.
TheProgressBarcontrolhasallthepseudoclassesofProgressIndicatorandNode.
Substructure
barRegion
ProgressIndicator
Styleclass:progressindicator
TheProgressBarcontrolhasallthepropertiesofRegionandNode.
Pseudoclasses
CSSPseudoclass Comments
determinate appliesiftheindeterminatevariableisfalse
indetermindate appliesiftheindeterminatevariableistrue
AlsohasallpseudoclassesofNode
Substructure
indicatorRegion
progressRegion
tickRegion
RadioButton
http://docs.oracle.com/cd/E17802_01/javafx/javafx/1.3/docs/api/javafx.scene/doc-les/cssref.html 18/25
03/11/2016 JavaFX CSS Reference Guide
Styleclass:radiobutton
CSSPseudoclass
CSSProperty
CSSProperty
CSSProperty Values Comments
Comments
Values
Default Comments
Values Default Comments Default Comments
CSSPseudoclass Comments
fxhpos [ left | center | right | leading | trailing ] center
TheRadioButtoncontrolhasallthepropertiesofRegion,LabeledandNode.
fxvpos [ top | center | baseline | bottom | page-end | page-start ] center
Substructure
radioRegion
dotRegion
labelLabel
ScrollBar
Styleclass:scrollbar
Pseudoclasses
CSSPseudoclass Comments
horizontal appliesifthisScrollBarishorizontal
vertical appliesifthisScrollBarisvertical
AlsohasallpseudoclassesofNode
Substructure
decrementbuttonRegion
decrementarrowRegion
trackRegion
thumbRegion
incrementbuttonRegion
incrementarrowRegion
ScrollView
Styleclass:scrollview
Pseudoclasses
CSSPseudoclass Comments
pannable appliesifthisScrollViewispannable
AlsohasallpseudoclassesofNode
Substructure
scrollbarScrollBar
scrollbarScrollBar
cornerRegion
Separator
Styleclass:separator
Pseudoclasses
http://docs.oracle.com/cd/E17802_01/javafx/javafx/1.3/docs/api/javafx.scene/doc-les/cssref.html 19/25
03/11/2016 JavaFX CSS Reference Guide
CSSPseudoclass
CSSProperty
CSSProperty
CSSProperty Values
Values Comments
Comments
Values
Comments
Default
Default
Comments
Comments
Comments
Default Comments
CSSPseudoclass Comments
horizontal
fxlines
fxcolumns appliesifthisSeparatorishorizontal
fxblockincrement <<i<
ni
u
tnm
etb
ge
egr
e> 10
r>10 5
vertical
fxeditable appliesifthisSeparatorisvertical
fxclicktoposition <<
bb
ooollee
aa >>true
nn false
fxmajortickunit
fxselectonfocus <<bn
ou
om
lb
een> true
ar 25
AlsohasallpseudoclassesofNode
fxminortickcount <integer> 3
Substructure
fxshowticklabels <boolean> false
fxshowtickmarks <boolean> false
lineRegion<boolean>
fxsnaptoticks false
fxvertical <boolean> false
Skin
TheSkinclasshasallthepropertiesofNode.
Slider
Styleclass:slider
Pseudoclasses
CSSPseudoclass Comments
horizontal appliesifthisSliderishorizontal
vertical appliesifthisSliderisvertical
AlsohasallpseudoclassesofNode
Substructure
axisNumberAxis
trackRegion
thumbRegion
TextBox
Styleclass:textbox
Pseudoclasses
CSSPseudoclass Comments
multiline appliesifthemultilinevariableistrue
AlsohasallpseudoclassesofNode
TextInputControl
CSSProperty Values Default Comments
fxcolumns <integer> 10
fxeditable <boolean> true
fxselectonfocus <boolean> true
AlsohasFontPropertiesandallpropertiesofNode
Pseudoclasses
CSSPseudoclass Comments
editable appliesifthisTextInputControliseditable
readonly appliesifthisTextInputControlisnoteditable
AlsohasallpseudoclassesofNode
http://docs.oracle.com/cd/E17802_01/javafx/javafx/1.3/docs/api/javafx.scene/doc-les/cssref.html 20/25
03/11/2016 JavaFX CSS Reference Guide
ToggleButton
CSSPseudoclass
CSSProperty
CSSProperty
CSSProperty
CSSProperty
Values
ValuesValues
Default
Comments
Comments
Default
Range
Values
Default
Default
Range
Comments
Range
Comments
Range
Comments
Values
Comments Default Range Comments
fxbottomshelffill
fxradiusscale <paint> <
rn
gu
bm
(b
2e
1r
0>
,210,2
110) > 0
Styleclass:togglebutton
fxbottomshelfstroke <paint> rgb(190,190,190)
TheToggleButtoncontrolhasallthepropertiesofRegion,LabeledandNode.
Pseudoclasses
CSSPseudoclass Comments
selected appliesifthisToggleButtonisselected
AlsohasallpseudoclassesofNode
Tooltip
Styleclass:tooltip
TheTooltipcontrolhasallthepropertiesofLabeledandNode.
Pseudoclasses
CSSPseudoclass Comments
showing appliesifthisTooltipisshowing
AlsohasallpseudoclassesofNode
Substructure
labelLabel
pagecornerRegion
javafx.scene.chart
AreaChart
CSSProperty Values Default Range Comments
fxdataopacity <number> 0.5 [0.0 ... 1.0]
AlsohasallpropertiesofXYChart,Chart&Node
BarChart
CSSProperty Values Default Range Comments
fxbargap <size> 4
fxbarfill <paint> null
fxbarstroke <paint> rgb(0,0,0,0.2)
fxcategorygap <size> 10
AlsohasallpropertiesofXYChart,Chart,ValueAxis,CategoryAxis&Node
BarChart3D
CSSProperty Values Default Range Comments
fxbottomshelffill <paint> rgb(210,210,210)
fxbottomshelfstroke <paint> rgb(190,190,190)
fxoffsetx <size> 8
fxoffsety <size> 8
fxsideshelffill <paint> rgb(230,230,230)
fxsideshelfstroke <paint> rgb(210,210,210)
fxzeroshelffill <paint> rgb(160,160,160,0.7)
fxzeroshelfstroke <paint> rgb(100,100,100,0.7)
AlsohasallpropertiesofBarChart,XYChart,Chart,ValueAxis,CategoryAxis&Node
BubbleChart
CSSProperty Values Default Range Comments
fxradiusscale <number> 1 >0
fxscalebubbleradiususingaxis <boolean> true
AlsohasallpropertiesofXYChart,Chart,ValueAxis&Node
Chart
CSSProperty Values Default Range Comments
fxchartbackgroundfill <paint> null
http://docs.oracle.com/cd/E17802_01/javafx/javafx/1.3/docs/api/javafx.scene/doc-les/cssref.html 21/25
03/11/2016 JavaFX CSS Reference Guide
CSSProperty
CSSProperty
CSSProperty
CSSProperty
CSSProperty
CSSProperty
Values
Values
Default
Default
Default
Range
Values
Range
Range
Comments
Comments
Default
Comments
Values Range
ValuesComments Default Default Range
Range
Comments
Comments
fxchartbackgroundstroke
fxclockwise <bo
<o
pl
ae
ia
nn
t>
> true null
fxchartbackgroundstrokewidth
fxpielabelfill <pa
<i
sn
it
z>
e> rgb(80,80,80) 1 >0
fxhoverstroke
fxpielabelfont <fo
<n
pt
a>
int> inherit dodgerblue
fxhoverstrokewidth
fxpielabelvisible <bo
<o
sl
ie
za
en
>> true 1.4 >0
fxinsets <number> | [ <number> <number> <number> <number> ] 10 10 10 10
fxlegendgap <size> 10
fxlegendside [ top | bottom | left | right ] bottom
fxlegendvisible <boolean> true
fxtitlefill <paint> #444444
fxtitlefont <font> inherit
fxtitlegap <size> 10
fxtitleside [ top | bottom | left | right ] top
AlsohasallpropertiesofNode
LineChart
CSSProperty Values Default Range Comments
fxdataopacity <number> 1.0
fxshowsymbols <boolean> true
AlsohasallpropertiesofXYChart,Chart,ValueAxis&Node
PieChart
CSSProperty Values Default Range Comments
fxclockwise <boolean> true
fxpielabelfill <paint> rgb(80,80,80)
fxpielabelfont <font> inherit
fxpielabelvisible <boolean> true
fxpiestroke <paint> WHITE
fxpiestrokewidth <size> 2
fxpietolabellinecurved <boolean> false
fxpietolabellineonelength <number> 15
fxpietolabellinestroke <paint> rgb(80,80,80)
fxpietolabellinestrokewidth <number> 1
fxpietolabellinetwolength <number> 25
fxpievaluelabelfill <paint> WHITE
fxpievaluelabelfont <font> inherit
fxpievaluevisible <boolean> true
fxstartangle <number> 0
AlsohasallpropertiesofChart&Node
PieChart3D
CSSProperty Values Default Range Comments
fxpiethickness <size> 35 >0
AlsohasallpropertiesofPieChart,Chart&Node
ScatterChart
CSSProperty Values Default Range Comments
fxdataopacity <number> 1.0 [0.0 ... 1.0]
AlsohasallpropertiesofXYChart,Chart,ValueAxis&Node
XYChart
CSSProperty Values Default Range Comments
fxhorizontalalternaterowfill <paint> rgb(0,0,0,0.03)
fxhorizontalgridlinestroke <paint> rgb(0,0,0,0.1)
fxhorizontalgridlinestrokedasharray <number> <number>+ 33
fxhorizontalgridlinestrokewidth <size> 1
fxhorizontalgridlinevisible <boolean> true
fxhorizontalzerolinevisible <boolean> true
fxplotbackgroundfill <paint> linear gradient #FFFFFF to #EEEEEE
fxplotbackgroundstroke <paint> #dddddd
fxplotbackgroundstrokewidth <size> 1
fxverticalalternaterowfill <paint> null
http://docs.oracle.com/cd/E17802_01/javafx/javafx/1.3/docs/api/javafx.scene/doc-les/cssref.html 22/25
03/11/2016 JavaFX CSS Reference Guide
fxverticalgridlinestroke
CSSProperty
CSSProperty
CSSProperty
CSSProperty
CSSProperty
Values
Values
CSSProperty
Default
Default
ValuesRange
Range
Default
Comments
Comments<paiComments
Range
ValuesnValues
t>Values Default rgb(0
Range ,0,0,
Default 0.1)
Default Comments
Range
Range Comments
Comments
fxaxisstroke
fxbackgroundinsets <num<b p
ear
i>
nt|
>[ <numb
fxverticalgridlinestrokedasharray <er
n>
umb<
en
rumb
> <e
nr
u> <
mbn
eu
rm
>be#
+ ra
>aa
<ana
uamber>] 3 35 5 5 5
fxaxisstrokewidth <pai
fxfill <n
st
i>
ze>
fxverticalgridlinestrokewidth <size> 1 b
> 0rg1(245,245,245)
fxlabelfill
fxverticalgridlinevisible<paint> <boolean> #333333 rue
t
fxverticalzerolinevisible <boolean> true
AlsohasallpropertiesofChart&Node
javafx.scene.chart.part
Axis
Styleclass:axis
CategoryAxis
CSSProperty Values Default Range Comments
fxendmargin <size> 5 >= 0
fxgapstartandend <boolean> true
fxstartmargin <size> 5 >= 0
AlsohasallpropertiesofAxis&Node
Legend
CSSProperty Values Default Range Comments
fxbackgroundinsets <number> | [ <number> <number> <number> <number> ] 5555
fxfill <paint> rgb(245,245,245)
fxstroke <paint> rgb(200,200,200)
fxstrokewidth <size> 1 >= 0 0=hairline
fxtextfill <paint> rgb(80,80,80)
fxvertical <boolean> false
AlsohasallpropertiesofNode
NumberAxis
CSSProperty Values Default Range Comments
fxtickunit <number> 10
AlsohasallpropertiesofValueAxis,Axis&Node
PlotSymbol
CSSProperty Values Default Range Comments
fxfill <paint> null
http://docs.oracle.com/cd/E17802_01/javafx/javafx/1.3/docs/api/javafx.scene/doc-les/cssref.html 23/25
03/11/2016 JavaFX CSS Reference Guide
CSSPseudoclass
CSSProperty
CSSProperty
CSSProperty
fxhoverfill Values
<Values
paint>Default
Default
Values
redComments
Comments
Range
Range
Comments
Default
Comments
Comments
Comments
Range Comments
AlsohasallpropertiesofAxis&Node
ValueAxis
CSSProperty Values Default Range Comments
fxminortickcount <integer> 5 >= 0
fxminorticklength <size> 5 >= 0
fxminortickvisible <boolean> true
AlsohasallpropertiesofAxis&Node
com.javafx.preview.control
CheckMenuItem
Pseudoclasses
CSSPseudoclass Comments
selected appliesifthisitemisselected
AlsohasallpseudoclassesofNode
Menu
Styleclass:menu
Pseudoclasses
CSSPseudoclass Comments
showing appliesifthisMenuisshowing
AlsohasallpseudoclassesofNode
MenuBar
Styleclass:menubar
MenuButton
Styleclass:menubutton
TheMenuButtoncontrolhasallthepropertiesofLabeledandNode.
Pseudoclasses
CSSPseudoclass Comments
openvertically appliesiftheopenVerticallyvariableistrue
AlsohasallpseudoclassesofNode
MenuItemBase
Styleclass:menuitem
PopupMenu
Styleclass:popupmenu
Pseudoclasses
CSSPseudoclass Comments
showing appliesifthisPopupMenuisshowing
AlsohasallpseudoclassesofNode
RadioMenuItem
Pseudoclasses
CSSPseudoclass Comments
http://docs.oracle.com/cd/E17802_01/javafx/javafx/1.3/docs/api/javafx.scene/doc-les/cssref.html 24/25
03/11/2016 JavaFX CSS Reference Guide
CSSPseudoclass
CSSProperty Values Default
Comments
Comments
Comments
Range Comments
selected appliesifthisitemisselected
AlsohasallpseudoclassesofNode
SplitMenuButton
Styleclass:splitmenubutton
ToolBar
Styleclass:toolbar
Pseudoclasses
CSSPseudoclass Comments
horizontal appliesifthisToolBarishorizontal
vertical appliesifthisToolBarisvertical
AlsohasallpseudoclassesofNode
TreeCell
Styleclass:treecell
Pseudoclasses
CSSPseudoclass Comments
selected appliesifthiscellisselected
AlsohasallpseudoclassesofNode
TreeView
Styleclass:treeview
References
[1]CSS2.1:http://www.w3.org/TR/CSS21/
[2]CSS3workinprogresshttp://www.w3.org/Style/CSS/currentwork(May2010).
[3]SVGPaths:http://www.w3.org/TR/SVG/paths.html
[4]CSSBackgroundsandBordersModuleLevel3(May2010):http://www.w3.org/TR/css3background/
http://docs.oracle.com/cd/E17802_01/javafx/javafx/1.3/docs/api/javafx.scene/doc-les/cssref.html 25/25