JavaFx自定义按钮的外观(JavaFx customize button's look)
我将图像上传到我的按钮,但它看起来像这样:
按钮的形状不像图像,按钮颜色在边缘仍然可见。 有没有办法改变这个?
I uploaded an image to my button, but it looks like this:
The button isn't shaped like the image, and the button colors are still visible on the edges. Is there a way to change this?
原文:https://stackoverflow.com/questions/41186428
更新时间:2020-02-12 01:44
最满意答案
使用:
button.setPadding(Insets.EMPTY);
Use:
button.setPadding(Insets.EMPTY);
2016-12-16
相关问答
创建一个只有图标的按钮非常简单。 如果你想要悬停效果,它会变得棘手,因此你应该使用NativeButton 。 Button btnLogout = new Button();
btnLogout.setIcon(new ThemeResource("icons/logout.png"));
btnLogout.addStyleName(Reindeer.BUTTON_LINK); // define it as a