2013-07-17 74 views

回答

5

您将使用CSS。您可以将背景和边框设置为transparent,然后使用悬停类来添加半透明边框。它最终会被这样的事情(请注意,你可能不得不做出一些调整仍然)

.button { 
    -fx-background-color: transparent, transparent, transparent, transparent; 
} 

.button:hover{ 
    -fx-background-color: transparent, rgba(0,0,0,.1), rgba(0,0,0,.1), transparent; 
} 

.button:armed { 
    -fx-background-color: transparent, rgba(0,0,0,.1), rgba(0,0,0,.1), rgba(0,0,0,.2); 
} 

申请你会使用类似的代码此样式表:

toolbar.getStylesheets().add("filename.css"); 

有在“javafx-2”标签的“Info”部分中有很多很好的参考资料。这里有几个要说明这个有用:

+0

谢谢你,你救了我! – user1786646

+0

什么是工具栏的类名? – santafebound

+0

根据http://docs.oracle.com/javafx/2/api/javafx/scene/doc-files/cssref.html#toolbar,工具栏的类名是'tool-bar' –