2015-03-25 43 views
3

这是我目前的颜色选择器:如何修改javafx colorpicker?

enter image description here

我怎样才能文体的颜色预览宽度,边框颜色和半径?是否有可能摆脱底部的“自定义颜色”选项,而不是默认的颜色使用我自己的一套颜色?

我试图用这个CSS:

.color-picker { 
-fx-skin: "CustomSkin"; 
-fx-background-color: white; 
-fx-background-radius: 2; 
-fx-padding: 0; 
-fx-background-insets: 0, 1; 
} 

.color-picker .color-picker-label .text { 
visibility: false; 
} 

.color-picker .color-picker-label{ 
-fx-scale-x: 1.53; 
-fx-scale-y: 1.53; 
-fx-spacing: 0; 
-fx-padding: 3; 
-fx-border-width: 0; 
-fx-background-insets: 0, 1; 
-fx-border-radius: 2; 
} 

回答

0

我知道这是一个老问题,但试图修改ColorPicker中预览时,我偶然发现了一个类似的问题,希望下面的可以帮助别人试图使类似的变化

为目标的CSS预览,你需要为肌肤包含持有预览为矩形

如窗格中使用.picker色

.picker-color { 
    -fx-border-color: green; 
} 

其靶向的控制的这一部分,允许你改变宽度等:

enter image description here