Java Code Examples for com.jfoenix.controls.JFXComboBox#setValue()

The following examples show how to use com.jfoenix.controls.JFXComboBox#setValue() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CrewEditorFX.java    From mars-sim with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Set up the crew gender choice
 */
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);
	}
}
 
Example 2
Source File: CrewEditorFX.java    From mars-sim with GNU General Public License v3.0 6 votes vote down vote up
/**
	 * Set up the crew sponsor choice
	 */
	public void setUpCrewSponsor() {
//		String n[] = new String[SIZE_OF_CREW];

		for (int i = 0; i < SIZE_OF_CREW; i++) {
			String sponsor = personConfig.getConfiguredPersonSponsor(i, ALPHA_CREW);
			System.out.println("setUpCrewSponsor sponsor : " + sponsor);
//			if (!sponsor.equals(sponsorName)) {
//				sponsor = sponsorName;
//			}
				
			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(sponsor);//n[i]);
			sponsorList.add(i, g);
			
		}
	}
 
Example 3
Source File: CrewEditorFX.java    From mars-sim with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Set up the crew job choice
 */
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);
	}
}
 
Example 4
Source File: CrewEditorFX.java    From mars-sim with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Set up the crew country choice
 */
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]);
		System.out.println("setUpCrewCountry country : " + n[i]);
		countryList.add(i, g);
	}
}