[英]JavaFX - Customized Button Shape
You need to use the -fx-shape property. 您需要使用-fx-shape属性。
You can find it in Oracle's reference guide: https://docs.oracle.com/javafx/2/api/javafx/scene/doc-files/cssref.html#references 您可以在Oracle参考指南中找到它: https : //docs.oracle.com/javafx/2/api/javafx/scene/doc-files/cssref.html#references
This is is also useful to understand how to draw the "path" associated with your shape: https://www.w3.org/TR/SVG/paths.html 这对于了解如何绘制与形状关联的“路径”也很有用: https : //www.w3.org/TR/SVG/paths.html
You may want to use an SVG editor for your shape's path; 您可能要使用SVG编辑器作为形状的路径。 for example: https://github.com/SVG-Edit/svgedit
例如: https : //github.com/SVG-Edit/svgedit
something like this should do the trick; 这样的事情应该可以解决问题; you should need to add the curves -fx-shape: "M50 100 L150 100 L180 250 L20 250 Z";
您应该添加曲线-fx-shape:“ M50 100 L150 100 L180 250 L20 250 Z”;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.