0% found this document useful (0 votes)
674 views25 pages

JavaFX CSS Reference Guide

This document provides a summary of the JavaFX CSS Reference Guide, which outlines how CSS styles are applied to JavaFX scene graph nodes. It discusses CSS value types, supported properties for different node types, and how CSS styles are loaded and applied asynchronously to override default styles and styles set programmatically. CSS styles are organized by node class, style class, and id selector, following conventions similar to HTML DOM elements. The guide provides details on CSS support and extensions for features specific to JavaFX applications and controls.

Uploaded by

plysri
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
674 views25 pages

JavaFX CSS Reference Guide

This document provides a summary of the JavaFX CSS Reference Guide, which outlines how CSS styles are applied to JavaFX scene graph nodes. It discusses CSS value types, supported properties for different node types, and how CSS styles are loaded and applied asynchronously to override default styles and styles set programmatically. CSS styles are organized by node class, style class, and id selector, following conventions similar to HTML DOM elements. The guide provides details on CSS support and extensions for features specific to JavaFX applications and controls.

Uploaded by

plysri
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 25

03/11/2016 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>

url ( [\"\']? <address> [\"\']? )

<address>canbeanabsoluteURI,forexample:

url(http://example.com)
url('http://example.com')
url("http://example.com")

oritcanberelativetothelocationoftheCSSfile.

<effect>

JavaFXCSScurrentlysupportstheDropShadowandInnerShadoweffectsfromtheJavaFXplatform.Seetheclassdocumentation
injavafx.scene.effectforfurtherdetailsaboutthesemanticsofthevariouseffectparameters.

DropShadow
Ahighleveleffectthatrendersashadowofthegivencontentbehindthecontent.

dropshadow( <blur-type> , <color> , <number> , <number> , <number> , <number> )


<blur-type> = [ gaussian | one-pass-box | three-pass-box | two-pass-box ]
<color>TheshadowColor.
<number>Theradiusoftheshadowblurkernel.Intherange[0.0...127.0],typicalvalue10.
<number>Thespreadoftheshadow.Thespreadistheportionoftheradiuswherethecontributionofthesourcematerialwillbe
100%.Theremainingportionoftheradiuswillhaveacontributioncontrolledbytheblurkernel.Aspreadof0.0willresultina
distributionoftheshadowdeterminedentirelybythebluralgorithm.Aspreadof1.0willresultinasolidgrowthoutwardofthe
sourcematerialopacitytothelimitoftheradiuswithaverysharpcutofftotransparencyattheradius.Valuesshouldbeintherange
[0.0...1.0].
<number>Theshadowoffsetinthexdirection,inpixels.
<number>Theshadowoffsetintheydirection,inpixels.

InnerShadow
Ahighleveleffectthatrendersashadowinsidetheedgesofthegivencontent.

innershadow( <blur-type> , <color> , <number> , <number> , <number> , <number> )


<blur-type> = [ gaussian | one-pass-box | three-pass-box | two-pass-box ]

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".

CSSProperty Values Default Comments


fxfont <font> inherit shorthandpropertyforfontsize,fontfamily,fontweightandfontstyle
fxfontfamily <font-family> inherit
fxfontsize <font-size> inherit
fxfontstyle <font-style> inherit
fxfontweight <font-weight> inherit

<paint>

Paintvaluescaneitherbeasolidcolorspecifiedinoneofthecolorsyntaxesortheycanbealinearorradialgradient.

<color> | <lineargradient> | <radialgradient>

LinearGradients<lineargradient>
linear ( <size> , <size> ) to ( <size> , <size> ) stops [ ( <number> , <color> ) ]+ [ repeat |
reflect ]?

Lineargradientcreatesagradientgoingthoughallthestopcolorsalongthelinebetweenthetwopointsspecifiedbythefirstand
second(<size>,<size>).Ifthesizesarepercentagesthentheyarerelativetothesizeoftheareabeingfilled.Percentageand
lengthsizescannotbemixedinasinglegradientdefinition.Thisexamplewillcreateagradientfromtoplefttobottomrightofthe
filledareawithredatthetopleftcornerandblackatthebottomright.

linear (0%,0%) to (100%,100%) stops (0.0,red) (1.0,black)

Thismorecomplexexamplewillcreatea50pxhighbaratthetopwitha3colorgradientwithwhiteunderneathfortherestofthe
filledarea.

linear (0,0) to (0,50px) stops (0.0,gray) (0.50,darkgray) (0.99,dimgray) (1.0,white)

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:

radial 100% stops (0.0,red) (0.50,darkgray) (1.0,black)


radial (25%,25%) , 50% focus (20%,20%) stops (0.0,gray) (0.50,darkgray) (1.0,dimgray) reflect

<color>

<named-color> | <looked-up-color> | <rgb-color> | <hsb-color> | <color-function>

NamedColors<named-color>
CSSsupportsabunchofnamedconstantcolors.Namedcolorscanbespecifiedwithjusttheirunquotednameforexample:

.button {
-fx-background-color: red;
}

ThenamedcolorsthatareavailableinCSSare:

aliceblue= antiquewhite= aquamarine=


aqua=#00ffff
#f0f8ff #faebd7 #7fffd4
azure=#f0ffff beige=#f5f5dc bisque=#ffe4c4 black=#000000
blanchedalmond blueviolet=
blue=#0000ff brown=#a52a2a
=#ffebcd #8a2be2
burlywood= cadetblue= chocolate=
chartreuse=#7fff00
#deb887 #5f9ea0 #d2691e
cornflowerblue=
coral=#ff7f50 cornsilk=#fff8dc crimson=#dc143c
#6495ed
darkcyan= darkgoldenrod=
cyan=#00ffff darkblue=#00008b
#008b8b #b8860b
darkgray= darkgreen= darkkhaki=
darkgrey=#a9a9a9
#a9a9a9 #006400 #bdb76b
darkmagenta= darkolivegreen= darkorange= darkorchid=
#8b008b #556b2f #ff8c00 #9932cc
darkred= darksalmon= darkseagreen= darkslateblue=
#8b0000 #e9967a #8fbc8f #483d8b
darkslategray= darkslategrey= darkturquoise= darkviolet=
#2f4f4f #2f4f4f #00ced1 #9400d3
deeppink= deepskyblue=
dimgray=#696969 dimgrey=#696969
#ff1493 #00bfff
dodgerblue= forestgreen=
firebrick=#b22222 floralwhite=#fffaf0
#1e90ff #228b22
gainsboro=
fuchsia=#ff00ff ghostwhite=#f8f8ff gold=#ffd700
#dcdcdc
goldenrod= greenyellow=
gray=#808080 green=#008000
#daa520 #adff2f
indianred=
grey=#808080 honeydew=#f0fff0 hotpink=#ff69b4
#cd5c5c
indigo=#4b0082 ivory=#fffff0 khaki=#f0e68c lavender=#e6e6fa
lavenderblush= lawngreen= lemonchiffon=
lightblue=#add8e6
#fff0f5 #7cfc00 #fffacd
lightcoral= lightgoldenrodyellow
lightcyan=#e0ffff lightgray=#d3d3d3
#f08080 =#fafad2
lightgreen= lightsalmon=
lightgrey=#d3d3d3 lightpink=#ffb6c1
#90ee90 #ffa07a
lightseagreen= lightskyblue= lightslategray= lightslategrey=
#20b2aa #87cefa #778899 #778899
lightsteelblue= limegreen=
lightyellow=#ffffe0 lime=#00ff00
#b0c4de #32cd32
mediumaquamarine
linen=#faf0e6 magenta=#ff00ff maroon=#800000
=#66cdaa
mediumblue= mediumorchid= mediumpurple= mediumseagreen=

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

#0000cd #ba55d3 #9370db #3cb371


mediumslateblue mediumspringgreen mediumturquoise= mediumvioletred=
=#7b68ee =#00fa9a #48d1cc #c71585
midnightblue=
mintcream=#f5fffa mistyrose=#ffe4e1 moccasin=#ffe4b5
#191970
navajowhite=
navy=#000080 oldlace=#fdf5e6 olive=#808000
#ffdead
olivedrab=
orange=#ffa500 orangered=#ff4500 orchid=#da70d6
#6b8e23
palegoldenrod= palegreen= paleturquoise= palevioletred=
#eee8aa #98fb98 #afeeee #db7093
papayawhip=
peachpuff=#ffdab9 peru=#cd853f pink=#ffc0cb
#ffefd5
powderblue=
plum=#dda0dd purple=#800080 red=#ff0000
#b0e0e6
rosybrown= royalblue= saddlebrown=
salmon=#fa8072
#bc8f8f #4169e1 #8b4513
sandybrown= seagreen=
seashell=#fff5ee sienna=#a0522d
#f4a460 #2e8b57
slategray=
silver=#c0c0c0 skyblue=#87ceeb slateblue=#6a5acd
#708090
slategrey= springgreen= steelblue=
snow=#fffafa
#708090 #00ff7f #4682b4
tan=#d2b48c teal=#008080 thistle=#d8bfd8 tomato=#ff6347
turquoise=
violet=#ee82ee wheat=#f5deb3 white=#ffffff
#40e0d0
whitesmoke= yellowgreen= transparent=
yellow=#ffff00
#f5f5f5 #9acd32 rgba(0,0,0,0)

LookedupColors<looked-up-color>
Withlookedupcolorsyoucanrefertoanyothercolorpropertythatissetonthecurrentnodeoranyofitsparents.Thisisavery
powerfulfeature,asitallowsagenericpaletteofcolorstobespecifiedonthescenethenusedthoughouttheapplication.Ifyou
wanttochangeoneofthosepalettecolorsyoucandosoatanylevelinthescenetreeanditwillaffectthatnodeandallits
decendents.Lookedupcolorsarenotlookedupuntiltheyareapplied,sotheyareliveandreacttoanystylechangesthatmight
occur,suchasreplacingapalettecoloratruntimewiththe"style"propertyonanode.

Inthefollowingexample,allbackgroundcolorofallbuttonsusesthelookedupcolor"abc".

.scene { abc: #f00 }


.button { -fx-background-color: abc }

RGBColors<rgb-color>
TheRGBcolormodelisusedinnumericalcolorspecifications.Ithasanumberofdifferentsupportedforms.

#<digit><digit><digit> | #<digit><digit><digit><digit><digit><digit> | rgb( <integer> ,


<integer> , <integer> ) | rgb( <integer> %, <integer>% , <integer>% ) | rgba( <integer> ,
<integer> , <integer> , <number> ) | rgba( <integer>% , <integer>% , <integer> %, <number> )

Theseexamplesallspecifythesamecolor:

em { color: #f00 } /* #rgb */


em { color: #ff0000 } /* #rrggbb */
em { color: rgb(255,0,0) }
em { color: rgb(100%, 0%, 0%) }
em { color: rgba(255,0,0,1) }

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:

em { color: rgb(255,0,0) } /* integer range 0 - 255 */


em { color: rgba(255,0,0,1) /* the same, with explicit opacity of 1 */
em { color: rgb(100%,0%,0%) } /* float range 0.0% - 100.0% */
em { color: rgba(100%,0%,0%,1) } /* the same, with explicit opacity of 1 */

HSBColors<hsb-color>
ColorscanbespecifiedusingtheHSB(sometimescalledHSV)colormodel,asfollows:

hsb( <number> , <number>% , <number>% ) | hsba( <number> , <number>% , <number>% , <number> )

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>

derive( <color> , <number>% )

Thederivefunctiontakesacolorandcomputesabrighterordarkerversionofthatcolor.Thesecondparameteristhebrightness
offset,rangingfrom100%to100%.Positivepercentagesindicatebrightercolorsandnegativepercentagesindicatedarkercolors.
Avalueof100%meanscompletelyblack,0%meansnochangeinbrightness,and100%meanscompletelywhite.

Ladder <ladder>

ladder(<color>) stops [ ( <number> , <color> ) ]+

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.

CSSProperty Values Default Comments


BACKGROUNDFILLS
<paint> [ ,
fxbackgroundcolor <paint> ]*
null Aseriesofpaintvaluesseparatedbycommas.
<size> | <size>
<size> <size> Aseriesofsizevaluesorsetsoffoursizevalues,separatedbycommas.Asinglesize
<size> [ , [ valuemeansallinsetsarethesame.Otherwise,thefourvaluesforeachinsetaregiven
fxbackgroundinsets <size> | <size>
null
intheordertop,right,bottom,left.Eachcommaseparatedvalueorsetofvaluesinthe
<size> <size>
seriesappliestothecorrespondingbackgroundcolor.
<size>] ]*
<size> | <size> Aseriesofradiusvaluesorsetsoffourradiusvalues,separatedbycommas.Asingle
<size> <size> radiusvaluemeanstheradiusofallfourcornersisthesame.Otherwise,thefourvalues
<size> [ , [
fxbackgroundradius <size> | <size>
null inthesetdeterminetheradiiofthetopleft,topright,bottomright,andbottomleft
<size> <size> corners,inthatorder.Eachcommaseparatedvalueorsetofvaluesintheseriesapplies
<size>] ]* tothecorrespondingbackgroundcolor.
BACKGROUNDIMAGES
fxbackgroundimage <uri> [ , <uri> ]* null AseriesofimageURIsseparatedbycommas.

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

CSSProperty Values Default Comments


fxtextfill <paint> inherit
AlsohasallpropertiesofRegion,Labeled&Node

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

CSSProperty Values Default Comments


fxpannable <boolean> true
fxvertical <boolean> true
AlsohasallpropertiesofRegion,Node

Pseudoclasses
CSSPseudoclass Comments
horizontal appliesifthisListViewishorizontal
vertical appliesifthisListViewisvertical
AlsohasallpseudoclassesofNode

PasswordBox
Styleclass:passwordbox

CSSProperty Values Default Comments


fxechochar <string> "*"
AlsohasallpropertiesofRegion,TextInputControl&Node

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

CSSProperty Values Default Comments


fxblockincrement <number> 10
fxclicktoposition <boolean> false
fxunitincrement <number> 1
AlsohasallpropertiesofRegionandNode

Pseudoclasses
CSSPseudoclass Comments
horizontal appliesifthisScrollBarishorizontal
vertical appliesifthisScrollBarisvertical
AlsohasallpseudoclassesofNode

Substructure
decrementbuttonRegion
decrementarrowRegion
trackRegion
thumbRegion
incrementbuttonRegion
incrementarrowRegion

ScrollView
Styleclass:scrollview

CSSProperty Values Default Comments


fxfittoheight <boolean> false
fxfittowidth <boolean> false
fxhbarpolicy [ never | always | as_needed ] as_needed
fxpannable <boolean> false
fxvbarpolicy [ never | always | as_needed ] as_needed
AlsohasallpropertiesofRegionandNode

Pseudoclasses
CSSPseudoclass Comments
pannable appliesifthisScrollViewispannable
AlsohasallpseudoclassesofNode

Substructure
scrollbarScrollBar
scrollbarScrollBar
cornerRegion

Separator
Styleclass:separator

CSSProperty Values Default Comments


fxhpos [ left | center | right | leading | trailing ] center
fxvpos [ top | center | baseline | bottom | page-end | page-start ] center
AlsohasallpropertiesofRegionandNode

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

CSSProperty Values Default Comments


fxblockincrement <number> 10
fxclicktoposition <boolean> false
fxmajortickunit <number> 25
fxminortickcount <integer> 3
fxshowticklabels <boolean> false
fxshowtickmarks <boolean> false
fxsnaptoticks <boolean> false
fxvertical <boolean> false
AlsohasallpropertiesofRegionandNode

Pseudoclasses
CSSPseudoclass Comments
horizontal appliesifthisSliderishorizontal
vertical appliesifthisSliderisvertical
AlsohasallpseudoclassesofNode

Substructure
axisNumberAxis
trackRegion
thumbRegion

TextBox
Styleclass:textbox

CSSProperty Values Default Comments


fxlines <integer> 5
AlsohasFontPropertiesandallpropertiesofRegion,TextInputControlandNode

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

CSSProperty Values Default Range Comments


fxaxisstroke <paint> #aaaaaa
fxaxisstrokewidth <size> 1 >0
fxlabelfill <paint> #333333
fxlabelfont <font> Verdana 12 shorthandforcorrespondingfontproperties
fxlabelfontfamily <font-family>
fxlabelfontsize <font-size>
fxlabelfontstyle <font-style>
fxlabelfontweight <font-weight>
fxlabeltickgap <size> 5
fxside [ top | bottom | left | right ] null
fxticklabelfill <paint> #444444
fxticklabelfont <font> Verdana 9 shorthandforcorrrespondingfontproperties
fxticklabelfontfamily <font-family>
fxticklabelfontsize <font-size>
fxticklabelfontstyle <font-style>
fxticklabelfontweight <font-weight>
fxticklabeltickgap <size> 3
fxticklabelsvisible <boolean> true
fxtickmarklength <size> 8 >= 0
fxtickmarkstroke <paint> #cccccc
fxtickmarkstrokewidth <size> 1 >0
fxtickmarkvisible <boolean> true
AlsohasallpropertiesofNode

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

CSSProperty Values Default Range Comments


fxfont <font>
AlsohasallpropertiesofNode

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

CSSProperty Values Default Range Comments


fxpannable <boolean> false
AlsohasallpropertiesofNode

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

You might also like