title: In JavaFX2.2, how to set the font size for text entered in input fields and table headers?
body: <p>In my JavaFX2.2 fxml program, I am finding that fonts do not scale properly. As a result, table headers and input data fields are disproportionately large. </p>
  
  <p>Is there any way to set the font size for text <strong>entered</strong> in the input fields? </p>
  
  <p>Is there any way to set the font size for text displayed in the table headers?</p>
  
  <p><img src="https://i.stack.imgur.com/TlLTA.png" alt="screenshot of javafx program"></p>
  
  <p><strong>SCCE</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;?import java.lang.*?&gt;
  &lt;?import java.util.*?&gt;
  &lt;?import javafx.scene.*?&gt;
  &lt;?import javafx.scene.control.*?&gt;
  &lt;?import javafx.scene.layout.*?&gt;
  &lt;?import javafx.geometry.Insets?&gt;
  &lt;?import javafx.scene.control.cell.*?&gt; 
  &lt;?import javafx.collections.*?&gt; 
  &lt;?import fxmltableview.*?&gt; 
  &lt;?import java.lang.*?&gt;
  &lt;?import java.util.*?&gt;
  &lt;?import javafx.collections.*?&gt;
  &lt;?import javafx.scene.*?&gt;
  &lt;?import javafx.scene.control.*?&gt;
  &lt;?import javafx.scene.layout.*?&gt;
  &lt;?import javafx.scene.paint.*?&gt;
  &lt;?import javafx.scene.text.*?&gt;
  &lt;?import javafx.collections.*?&gt;
  &lt;?import java.lang.*?&gt;
  &lt;?import fxmltableview.Person?&gt;
  
  &lt;Scene xmlns:fx="http://javafx.com/fxml" &gt;
  
      &lt;GridPane alignment="center" hgap="10" vgap="10"&gt;
          &lt;padding&gt;
              &lt;Insets top="10" right="10" bottom="10" left="10"/&gt;
          &lt;/padding&gt;
          &lt;Label  text="Address Book: This text is in font size 12 on Win7" GridPane.columnIndex="0" GridPane.rowIndex="0"&gt;
              &lt;font&gt;
                  &lt;Font size="12.0"/&gt;
              &lt;/font&gt;
          &lt;/Label&gt;
          &lt;TextField fx:id="textField" GridPane.columnIndex="0" GridPane.rowIndex="1"&gt;
              input text field. See how large I am!!!
          &lt;/TextField&gt;
          &lt;TableView GridPane.columnIndex="0" GridPane.rowIndex="2"&gt;
              &lt;columns&gt;
                  &lt;TableColumn text="First Name"&gt;
                      &lt;cellValueFactory&gt;
                          &lt;PropertyValueFactory property="firstName" /&gt;
                      &lt;/cellValueFactory&gt;
                  &lt;/TableColumn&gt;
                  &lt;TableColumn text="Last Name"&gt;
                      &lt;cellValueFactory&gt;
                          &lt;PropertyValueFactory property="lastName" /&gt;
                      &lt;/cellValueFactory&gt;
                  &lt;/TableColumn&gt;
                  &lt;TableColumn text="Email Address"&gt;
                      &lt;cellValueFactory&gt;
                          &lt;PropertyValueFactory property="email" /&gt;
                      &lt;/cellValueFactory&gt;
                  &lt;/TableColumn&gt;
              &lt;/columns&gt; 
              &lt;items&gt;
                  &lt;FXCollections fx:factory="observableArrayList"&gt;
                      &lt;Person firstName="Jacob" lastName="Smith"  
                              email="jacob.smith@example.com"/&gt;
                      &lt;Person firstName="Isabella" lastName="Johnson" 
                              email="isabella.johnson@example.com"/&gt;
                      &lt;Person firstName="Ethan" lastName="Williams" 
                              email="ethan.williams@example.com"/&gt;
                      &lt;Person firstName="Emma" lastName="Jones"
                              email="emma.jones@example.com"/&gt;
                      &lt;Person firstName="Michael" lastName="Brown" 
                              email="michael.brown@example.com"/&gt;
                  &lt;/FXCollections&gt;
              &lt;/items&gt; 
          &lt;/TableView&gt;
      &lt;/GridPane&gt;
  &lt;/Scene&gt;
  
  /*
   * To change this template, choose Tools | Templates
   * and open the template in the editor.
   */
  package fxmltableview;
  
  import javafx.beans.property.SimpleStringProperty;
  
  public class Person {
     private final SimpleStringProperty firstName = new SimpleStringProperty("");
     private final SimpleStringProperty lastName = new SimpleStringProperty("");
     private final SimpleStringProperty email = new SimpleStringProperty("");
  
  public Person() {
          this("", "", "");
      }
  
      public Person(String firstName, String lastName, String email) {
          setFirstName(firstName);
          setLastName(lastName);
          setEmail(email);
      }
  
      public String getFirstName() {
          return firstName.get();
      }
  
      public void setFirstName(String fName) {
          firstName.set(fName);
      }
  
      public String getLastName() {
          return lastName.get();
      }
  
      public void setLastName(String fName) {
          lastName.set(fName);
      }
  
      public String getPrimary() {
          return getEmail();
      }
  
      public String getSecondary() {
          return getEmail();
      }
  
      public String getEmail() {
          return email.get();
      }
  
      public void setEmail(String fName) {
          email.set(fName);
      }
  }
  
  public class FXMLTableViewController implements Initializable {
  
      @FXML
      private Label label;
  
      @FXML
      private void handleButtonAction(ActionEvent event) {
          System.out.println("You clicked me!");
          label.setText("Hello World!");
      }
  
      @Override
      public void initialize(URL url, ResourceBundle rb) {
          // TODO
      }    
  }
  
  package fxmltableview;
  
  import javafx.application.Application;
  import javafx.fxml.FXMLLoader;
  import javafx.scene.Parent;
  import javafx.scene.Scene;
  import javafx.stage.Stage;
  
  /**
   *
   * @author 
   */
  public class FXMLTableView extends Application {
  
      @Override
      public void start(Stage primaryStage) throws Exception {
         primaryStage.setTitle("FXML TableView Example");
         primaryStage.setScene
         ((Scene)FXMLLoader.load(getClass().getResource("fxml_tableview.fxml")));
         primaryStage.show();
      }
  
      /**
       * The main() method is ignored in correctly deployed JavaFX application.
       * main() serves only as fallback in case the application can not be
       * launched through deployment artifacts, e.g., in IDEs with limited FX
       * support. NetBeans ignores main().
       *
       * @param args the command line arguments
       */
      public static void main(String[] args) {
          launch(args);
      }
  }
  </code></pre>