javafx 创建一个按钮
示例
创建aButton很简单:
Button sampleButton = new Button();
这将创建一个新的Button,内部没有任何文本或图形。
如果要Button使用文本创建一个,只需使用带有Stringas参数的构造函数(用于设置textProperty的Button):
Button sampleButton = new Button("点击我!");如果您想创建一个Button内部带有图形或其他图形的Node,请使用以下构造函数:
Button sampleButton = new Button("I have an icon", new ImageView(new Image("icon.png")));
热门推荐
10 病人祝福语老师寄语简短
11 新娘生孩子祝福语简短
12 婆婆66岁祝福语简短
13 今天孩子高考祝福语简短
14 送彩票生日祝福语简短
15 分别祝福语简短情话英文
16 画室揭牌仪式祝福语简短
17 女友妈妈生日祝福语简短
18 离别赠言离职祝福语简短