B4J Question How to change TextArea background color with CSSUtils?

ThRuST

Well-Known Member
Licensed User
Longtime User
Like the headline reads How to change TextArea background color with CSSUtils?

The following code only sets the color for the border (I'm using Color picker dialog)

And "fx-background" has no effect. CSSUtils.SetBackGroundColor.. is the same as below.

Code:
CSSUtils.SetStyleProperty(TextArea1,"-fx-background-color", CSSUtils.ColorToHex(Value))

How to do this?
 
Last edited:
This is what it looks like. I am using a TextArea in a TabPane. Document tab=HTMLeditor / Code Tab=TextArea)
I use a CSS file for the design were I also set textarea properties. Might be that?

cssutils.JPG


Code
Code:
Sub ColorPickerBgr_ValueChanged (Value As Paint)

    Log (Value)
    CSSUtils.SetBackgroundColor(TextAreaCode, fx.Colors.Red)
 
End Sub

CSS
.text-area {

-fx-border-width: 0;
-fx-border-color: Black;
-fx-font-family: Consolas;
-fx-font-size: 10;
-fx-text-fill: #93c74b;
-fx-font-weight: Normal;
-fx-display-caret:true;
}

.text-area .content
{
-fx-background-color: #1e1e1e;
}

text-area.scroll-pane
{
-fx-border-color: Black;
}
 
Last edited:
Upvote 0
I removed the -fx-background-color in .text-area .context but the problem is still the same. I was hoping CSSUtils would override the CSS settings and in Internal Designer (yes I am only using it since it's better than Scene Builder :) mostly because of the scaling script which is extremely useful)
 
Upvote 0
Yes I will do that. Also as a way to debug it to build it step by step that should be helpful. Thanks
 
Upvote 0
Back
Top