简体   繁体   English

没有FXML的情况下如何更改按钮的背景色? #JAVAFX

[英]How can I change the background color in the button without FXML? #JAVAFX

I've been trying to change the color of the window completely for a long time. 我一直在尝试完全改变窗口的颜色。 I am missing the lower section. 我错过了下半部分。

Can anyone help me? 谁能帮我?

This is the code. 这是代码。 I apologize for my beginner knowledge. 对于我的初学者知识,我深表歉意。

在此处输入图片说明

这是一个演示

If You want to do something like this the Thing You can do is Using a CSS file in javaFX FXML project if its not a javaFX FXML Project then I'm afraid you must share the source code of your project... 如果您想做这样的事情,您可以做的就是在javaFX FXML项目中使用CSS文件(如果它不是javaFX FXML项目),那么恐怕您必须共享项目的源代码...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM