【发布时间】:2010-04-15 12:48:50
【问题描述】:
我的 JavaFX 应用程序中有这个简单的小表单。
我想用一个按钮来改变firstNameText和firstNameText。
我没有能力,我是新手。我试过下面的代码,我的错误在哪里?
def lastNameLabel = Label { text: "Last Name" };
def firstNameLabel = Label { text: "First Name" };
var lastNameText = TextBox { text: "Last Name" };
var firstNameText = TextBox { text: "First Name" };
def cancelButton = Button {
text: "Cancel"
action: function() {
lastNameText = TextBox { text: "ciao" };
firstNameText = TextBox { text: "ciao" };
}
};
【问题讨论】: