Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 使圆形按钮的外线变大_Java_Css_Javafx - Fatal编程技术网

Java 使圆形按钮的外线变大

Java 使圆形按钮的外线变大,java,css,javafx,Java,Css,Javafx,我有以下用于javafx按钮的css文件: #circle { -fx-background-color: green, white; -fx-background-radius: 100; -fx-background-insets: 0; -fx-text-fill: black; -fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.6) , 5, 0.0 , 0 , 1 ); } 所以它基本上是一个圆

我有以下用于javafx按钮的css文件:

#circle {
-fx-background-color:
        green,
        white;
-fx-background-radius: 100;
-fx-background-insets: 0;
-fx-text-fill: black;
-fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.6) , 5, 0.0 , 0 , 1 );
}

所以它基本上是一个圆形的白色按钮,外线是绿色的。我的问题是绿色的外线很细。有没有办法使外线变大?

你能用
-fx stroke
来指定绿色外线吗? 一般来说:

#circle {
  -fx-background-color: white;
  -fx-stroke: green;
  -fx-stroke-width: 5;
  ...rest of the CSS
}

大多数情况下,当需要特定的外线时,会使用border属性

#circle {
    -fx-background-color: white;
    -fx-border-color: green;
    -fx-border-radius: 100;
    -fx-border-width: 1;
    -fx-background-radius: 100;
    -fx-background-insets: 0;
    -fx-text-fill: black;
    -fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.6) , 5, 0.0 , 0 , 1 );
}
为了获得相同的背景形状,还必须将
-fx边框半径
设置为与
-fx背景半径
相同的值

正如其名称所示,您可以使用
-fx border width
属性放大边框


试过了,但没用。遗憾的是,外线就这样完全消失了。