title: How to set one text in ComboBox items and get different value in javafx fxml
body: <p>I want to set one combo box value like this </p>
  
  <pre><code>&lt;ComboBox fx:id="dimensionCombo" editable="true" promptText="Other" prefWidth="150.0" GridPane.columnIndex="1" GridPane.rowIndex="13" GridPane.vgrow="ALWAYS"&gt;
              &lt;items&gt;
                  &lt;FXCollections fx:factory="observableArrayList"&gt;
  
                    &lt;String fx:value="30X20" /&gt;
                    &lt;String fx:value="30X40" /&gt;
                    &lt;String fx:value="30X50" /&gt;
                    &lt;String fx:value="60X40" /&gt;
  
                  &lt;/FXCollections&gt;
  &lt;/ComboBox&gt;
  </code></pre>
  
  <p>But when I do <code>dimensionCombo.getValue()</code> , I should get a different value like <code>600</code> for <code>&lt;String fx:value="30X20" /&gt;</code> , <code>1200</code> for <code>&lt;String fx:value="30X40" /&gt;</code> and so on. Is this possible? if yes how?</p>
  
  <p>Now i'm doing (In Controller)</p>
  
  <pre><code>...
  
  if(dimensionCombo.getValue().equals("30X20")) {
      int value = 600;
  }
  else if(dimensionCombo.getValue().equals("30X40")) {
      int value = 1200;
  }
  
  ...
  </code></pre>
  
  <p>Is there any better way of doing this?</p>