如何在矩形的中心添加文本?我一直在寻找并没有找到办法做到这一点.
见下面的课程:
public class Agent extends Rectangle{
public Agent() {
setWidth(60);
setHeight(60);
setArcWidth(60);
setArcHeight(60);
setFill(Color.BLUEVIOLET.deriveColor(0, 1.2, 1, 0.6));
setStroke(Color.BLUEVIOLET);
}
}
Run Code Online (Sandbox Code Playgroud)
谢谢!
ROM*_*eer 13
在a中添加Text元素和Agent(Rectangle)元素StackPane.
Text text = new Text("...");
...
StackPane stack = new StackPane();
stack.getChildren().addAll(agent, text);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
16472 次 |
| 最近记录: |