下面列出了javafx.scene.control.ContentDisplay#LEFT 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
public static ContentDisplay getControlContent(String value) {
if (value == null) {
return ContentDisplay.GRAPHIC_ONLY;
}
switch (value.toLowerCase()) {
case "graphic":
return ContentDisplay.GRAPHIC_ONLY;
case "text":
return ContentDisplay.TEXT_ONLY;
case "top":
return ContentDisplay.TOP;
case "left":
return ContentDisplay.LEFT;
case "right":
return ContentDisplay.RIGHT;
case "bottom":
return ContentDisplay.BOTTOM;
case "center":
return ContentDisplay.CENTER;
default:
return ContentDisplay.GRAPHIC_ONLY;
}
}
/** Returns the selected content display */
private ContentDisplay setDisplay() {
if (cbo.getValue().equals("TOP"))
return ContentDisplay.TOP;
else if (cbo.getValue().equals("BOTTOM"))
return ContentDisplay.BOTTOM;
else if (cbo.getValue().equals("LEFT"))
return ContentDisplay.LEFT;
else
return ContentDisplay.RIGHT;
}