(翻译)第九回 JavaFX2.0按钮Button
原文地址http://download.oracle.com/javafx/2.0/ui_controls/button.htm#CJHEEACB
?
?
Button类可通过JavaFX API让用户通过点击一个按钮来处理某个行为。Button类是Labeled 类的子类,它可以显示文本、图片(当然也可以同时显示二者)。Figure 3-1展示了具有各种效果的按钮。通过本文你就能学会怎么创建这样的按钮。
Description of "Figure 3-1 Types of Buttons"
Description of "Figure 3-2 Button with Icon"
?Example 3-2 和Figure 3-2 中的图标是一个ImageView 对象。不过,也可以使用其他的图形对象,如javafx.scene.shape 包中的各种形状。当按钮同时具有文本和图形内容时,可以使用setGraphicTextGap方法在二者之间设置间隙。
?Button类的默认皮肤有如下的视觉区别。Figure 3-3 用一个图标按钮展示了这种区别。
Description of "Figure 3-3 Button States"
Description of "Figure 3-4 Button with Drop Shadow"