本文整理汇总了Java中com.jfoenix.controls.JFXComboBox.setValue方法的典型用法代码示例。如果您正苦于以下问题:Java JFXComboBox.setValue方法的具体用法?Java JFXComboBox.setValue怎么用?Java JFXComboBox.setValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jfoenix.controls.JFXComboBox
的用法示例。
在下文中一共展示了JFXComboBox.setValue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addEnum
import com.jfoenix.controls.JFXComboBox; //导入方法依赖的package包/类
/**
* Add an enumeration of options to a wizard step.
*
* @param fieldName
* @param defaultValue
* is the index of the value in your options array. Can be set <
* 0 to empty the combobox as default.
* @param prompt
* the tooltip to show
* @param options
* your array of options, use a {@link IconLabel} object to add
* icons to your options. Only the text will be selected.
* @return
*/
@SuppressWarnings("unchecked")
public WizardStepBuilder addEnum(final String fieldName, final int defaultValue, final String prompt,
final IconLabel... options)
{
final JFXComboBox<IconLabel> jfxCombo = new JFXComboBox<>();
jfxCombo.getItems().addAll(options);
jfxCombo.setPromptText(prompt);
if (defaultValue < 0)
jfxCombo.setValue(new IconLabel(null, ""));
else
jfxCombo.setValue(options[defaultValue]);
this.current.getData().put(fieldName, new SimpleObjectProperty<IconLabel>());
this.current.getData().get(fieldName).bind(jfxCombo.valueProperty());
final Label label = new Label(fieldName);
GridPane.setHalignment(label, HPos.RIGHT);
GridPane.setHalignment(jfxCombo, HPos.LEFT);
this.current.add(label, 0, this.current.getData().size() - 1);
this.current.add(jfxCombo, 1, this.current.getData().size() - 1);
return this;
}
示例2: setUpCrewGender
import com.jfoenix.controls.JFXComboBox; //导入方法依赖的package包/类
public void setUpCrewGender() {
String s[] = new String[SIZE_OF_CREW];
for (int j = 0; j < SIZE_OF_CREW; j++) {
GenderType n = personConfig.getConfiguredPersonGender(j, ALPHA_CREW);
// convert MALE to M, FEMAL to F
s[j] = n.toString();
if (s[j].equals("MALE"))
s[j] = "M";
else
s[j] = "F";
JFXComboBox<String> g = setUpCB(GENDER_ROW, j); // 2 = Gender
// g.setMaximumRowCount(2);
gridPane.add(g, j + 1, GENDER_ROW); // gender's row = 2
// genderOListComboBox.add(g);
g.setValue(s[j]);
genderList.add(j, g);
}
}
示例3: setUpCrewJob
import com.jfoenix.controls.JFXComboBox; //导入方法依赖的package包/类
public void setUpCrewJob() {
String n[] = new String[SIZE_OF_CREW];
for (int i = 0; i < SIZE_OF_CREW; i++) {
n[i] = personConfig.getConfiguredPersonJob(i, ALPHA_CREW);
JFXComboBox<String> g = setUpCB(JOB_ROW, i); // 3 = Job
// g.setMaximumRowCount(8);
gridPane.add(g, i + 1, JOB_ROW); // job's row = 3
g.setValue(n[i]);
jobList.add(i, g);
}
}
示例4: setUpCrewSponsor
import com.jfoenix.controls.JFXComboBox; //导入方法依赖的package包/类
public void setUpCrewSponsor() {
String n[] = new String[SIZE_OF_CREW];
for (int i = 0; i < SIZE_OF_CREW; i++) {
n[i] = personConfig.getConfiguredPersonSponsor(i, ALPHA_CREW);
JFXComboBox<String> g = setUpCB(SPONSOR_ROW, i); // 4 = sponsor
// g.setMaximumRowCount(8);
gridPane.add(g, i + 1, SPONSOR_ROW); // sponsor's row = 4
g.setValue(n[i]);
sponsorList.add(i, g);
}
}
示例5: setUpCrewCountry
import com.jfoenix.controls.JFXComboBox; //导入方法依赖的package包/类
public void setUpCrewCountry() {
String n[] = new String[SIZE_OF_CREW];
for (int i = 0; i < SIZE_OF_CREW; i++) {
n[i] = personConfig.getConfiguredPersonCountry(i, ALPHA_CREW);
JFXComboBox<String> g = setUpCB(COUNTRY_ROW, i); // 5 = Country
// g.setMaximumRowCount(8);
gridPane.add(g, i + 1, COUNTRY_ROW); // country's row = 5
g.setValue(n[i]);
countryList.add(i, g);
}
}