B4J Question java FX style

hookshy

Well-Known Member
Licensed User
Longtime User
How exactly do you use styleclasses ?

I did try to understand how to change the font style of a combo-box !

I see that the code :
B4X:
    For i=0 To varspin.StyleClasses.Size-1   
    Log("style: "&varspin.StyleClasses.Get(i))
    Next
returns 2 results : combo-box and combo-box-base which are substructures of combo-box

How do I reference the label ..of substructure in order to modify font ? and other things ..
Thanks
 
Upvote 0

hookshy

Well-Known Member
Licensed User
Longtime User
In the java fx scene bulder I tried to add a calss name "label" then set the combo-box style with -fx-font-size: 12 ;

the below statement does not work on b4j
varspin.StyleClasses.Add("label") '???? from another planet
varspin.Style= "-fx-font-size: 12 ;"
 
Last edited:
Upvote 0

Daestrum

Expert
Licensed User
Longtime User
try
xxx.Style = "-fx-font: 12px Default"
 
Upvote 0

hookshy

Well-Known Member
Licensed User
Longtime User
B4X:
java.lang.StackOverflowError
    at com.sun.javafx.css.StyleManager$StylesheetContainer.getIndicesOfParentsWithStylesheets(StyleManager.java:1120)
    at com.sun.javafx.css.StyleManager$StylesheetContainer.getIndicesOfParentsWithStylesheets(StyleManager.java:1120)
    at com.sun.javafx.css.StyleManager$StylesheetContainer.getIndicesOfParentsWithStylesheets(StyleManager.java:1120)
    at com.sun.javafx.css.StyleManager$StylesheetContainer.getIndicesOfParentsWithStylesheets(StyleManager.java:1120)
    at com.sun.javafx.css.StyleManager$StylesheetContainer.getIndicesOfParentsWithStylesheets(StyleManager.java:1120)
    at com.sun.javafx.css.StyleManager$StylesheetContainer.getIndicesOfParentsWithStylesheets(StyleManager.java:1120)
    at com.sun.javafx.css.StyleManager$StylesheetContainer.getIndicesOfParentsWithStylesheets(StyleManager.java:1120)
    at com.sun.javafx.css.StyleManager$StylesheetContainer.getIndicesOfParentsWithStylesheets(StyleManager.java:1120)
    at com.sun.javafx.css.StyleManager$StylesheetContainer.getStyleHelper(StyleManager.java:1194)
    at com.sun.javafx.css.StyleManager$StylesheetContainer.access$1300(StyleManager.java:1051)
    at com.sun.javafx.css.StyleManager.getStyleHelper(StyleManager.java:994)
    at javafx.scene.Node.impl_createStyleHelper(Node.java:7436)
    at javafx.scene.Node.impl_processCSS(Node.java:7406)
    at javafx.scene.Parent.impl_processCSS(Parent.java:1146)
    at javafx.scene.control.Control.impl_processCSS(Control.java:1154)
    at javafx.scene.Node.impl_reapplyCSS(Node.java:7363)
    at javafx.scene.control.Labeled$6.invalidated(Labeled.java:323)
    at javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:129)
    at javafx.beans.property.ObjectPropertyBase.set(ObjectPropertyBase.java:163)
    at com.sun.javafx.css.StyleableObjectProperty.set(StyleableObjectProperty.java:70)
    at com.sun.javafx.css.StyleableObjectProperty.applyStyle(StyleableObjectProperty.java:58)
    at com.sun.javafx.css.StyleableProperty.set(StyleableProperty.java:70)
    at com.sun.javafx.css.StyleHelper.transitionToState(StyleHelper.java:900)
    at javafx.scene.Node.impl_processCSS(Node.java:7418)
    at javafx.scene.Parent.impl_processCSS(Parent.java:1146)
    at javafx.scene.control.Control.impl_processCSS(Control.java:1154)
    at javafx.scene.Node.impl_reapplyCSS(Node.java:7363)
    at javafx.scene.control.Labeled$6.invalidated(Labeled.java:323)
    at javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:129)
    at javafx.beans.property.ObjectPropertyBase.set(ObjectPropertyBase.java:163)
    at com.sun.javafx.css.StyleableObjectProperty.set(StyleableObjectProperty.java:70)
    at com.sun.javafx.css.StyleableObjectProperty.applyStyle(StyleableObjectProperty.java:58)
    at com.sun.javafx.css.StyleableProperty.set(StyleableProperty.java:70)
    at com.sun.javafx.css.StyleHelper.transitionToState(StyleHelper.java:900)
    at javafx.scene.Node.impl_processCSS(Node.java:7418)
    at javafx.scene.Parent.impl_processCSS(Parent.java:1146)
    at javafx.scene.control.Control.impl_processCSS(Control.java:1154)
    at javafx.scene.Node.impl_reapplyCSS(Node.java:7363)
    at javafx.scene.control.Labeled$6.invalidated(Labeled.java:323)
    at javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:129)
    at javafx.beans.property.ObjectPropertyBase.set(ObjectPropertyBase.java:163)
    at com.sun.javafx.css.StyleableObjectProperty.set(StyleableObjectProperty.java:70)
    at com.sun.javafx.css.StyleableObjectProperty.applyStyle(StyleableObjectProperty.java:58)
    at com.sun.javafx.css.StyleableProperty.set(StyleableProperty.java:70)
    at com.sun.javafx.css.StyleHelper.transitionToState(StyleHelper.java:900)
    at javafx.scene.Node.impl_processCSS(Node.java:7418)
    at javafx.scene.Parent.impl_processCSS(Parent.java:1146)
 
Upvote 0
Top