B4J Question MenuBar Background

Guenter Becker

Active Member
Licensed User
Hello,
Sorry I'm no CSS programmer. Need to give the Menubar Bar Background a shaded Color. Tried some CSS from the Web but they don't work.
Anyone helping me with a snipped. Thankyou.
 

PaulMeuris

Well-Known Member
Licensed User
You could do a google search with the words: javafx css gradient
The AI overview gives you all the possible css settings.
1759723836040.png

Changes in your MyMenu.css file:
CSS:
{
    -fx-my-menu-color: linear-gradient(from 0% 0% to 100% 100%, #ff0000, #0000ff);    /*#0134fa;*/
}

.menu-bar {
    -fx-background-color: -fx-my-menu-color;
}
In your Main module you can comment the line:
B4X:
'    b4x.SetColorAndBorder(xui.color_blue,2dip,xui.Color_Black,5dip)
 
Upvote 0

Guenter Becker

Active Member
Licensed User
Godd Morning PaulMeuris this is what i want it works thank you.
 
Upvote 0

Guenter Becker

Active Member
Licensed User
You could do a google search with the words: javafx css gradient
The AI overview gives you all the possible css settings.
View attachment 167592
Changes in your MyMenu.css file:
CSS:
{
    -fx-my-menu-color: linear-gradient(from 0% 0% to 100% 100%, #ff0000, #0000ff);    /*#0134fa;*/
}

.menu-bar {
    -fx-background-color: -fx-my-menu-color;
}
In your Main module you can comment the line:
B4X:
'    b4x.SetColorAndBorder(xui.color_blue,2dip,xui.Color_Black,5dip)
 
Upvote 0

Guenter Becker

Active Member
Licensed User
Hello Paul,
looked on your named web page and found this
CSS:
.linear-grad-to-top{
    -fx-background-color: linear-gradient(to top, #ff7f50, #6a5acd);
}

Sorry I'm no CSS prgrammer and I tried to implement it but get always errors where must I place this?
 
Upvote 0
Top