title: JavaFX Password field not working
body: <p>In scene builder I have a password field with the fx:id passwordBox and in the corresponding controller class I have </p>
  
  <p>@FXML private static PasswordField passwordBox = new PasswordField();</p>
  
  <p>I ALSO TRIED</p>
  
  <p>@FXML private static PasswordField passwordBox;</p>
  
  <p>When I run the program the letters in the password field are plain text. The same thing happens when I preview the window in scene builder.  The password field is a PasswordField so I didn't mistake it for a TextField.</p>
  
  <p>What can I do?</p>
  
  <p>Edit:
  FXML file</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;?import java.lang.*?&gt;
  &lt;?import java.net.*?&gt;
  &lt;?import javafx.scene.control.*?&gt;
  &lt;?import javafx.scene.image.*?&gt;
  &lt;?import javafx.scene.layout.*?&gt;
  &lt;?import javafx.scene.layout.AnchorPane?&gt;
  &lt;?import javafx.scene.text.*?&gt;
  
  &lt;AnchorPane fx:id="mainAnchor" opacity="1.0" prefHeight="200.0" prefWidth="408.0000999999975" styleClass="back" xmlns:fx="http://javafx.com/fxml" fx:controller="application.MainController"&gt;
    &lt;!-- TODO Add Nodes --&gt;
    &lt;children&gt;
      &lt;Label fx:id="serverIPLbl" layoutX="14.0" layoutY="28.0" prefWidth="175.0" text="Server IP"&gt;
        &lt;font&gt;
          &lt;Font name="Segoe UI" size="12.0" fx:id="x1" /&gt;
        &lt;/font&gt;
      &lt;/Label&gt;
      &lt;TextField fx:id="serverIPBox" layoutX="14.0" layoutY="50.0" prefWidth="175.0" /&gt;
      &lt;Label fx:id="portLbl" font="$x1" layoutX="215.0" layoutY="28.0" prefWidth="175.0" text="Port" /&gt;
      &lt;TextField fx:id="portBox" layoutX="215.0" layoutY="50.0" prefWidth="175.0" /&gt;
      &lt;Label fx:id="passwordLbl" font="$x1" layoutX="14.0" layoutY="81.0" prefWidth="175.0" text="Server Password" /&gt;
      &lt;ImageView fx:id="settingsButton" fitHeight="23.0" fitWidth="23.0" layoutX="14.0" layoutY="137.0" onMouseClicked="#settingsClicked" pickOnBounds="true" preserveRatio="true"&gt;
        &lt;image&gt;
          &lt;Image url="@../images/gear.png" /&gt;
        &lt;/image&gt;
      &lt;/ImageView&gt;
      &lt;Button id="startServer" fx:id="connectButton" layoutX="14.0" layoutY="167.0" mnemonicParsing="false" onAction="#connectClicked" prefHeight="22.0" prefWidth="376.0" text="Connect" /&gt;
      &lt;Label fx:id="usernameLbl" font="$x1" layoutX="215.0" layoutY="81.0" prefWidth="175.0" text="Username" /&gt;
      &lt;TextField id="serverIPBox" fx:id="usernameBox" layoutX="215.0" layoutY="103.0" prefWidth="175.0" promptText="a-z A-Z 0-9 _ - chars allowed" /&gt;
      &lt;ImageView id="favoriteButton" fx:id="favoritesButton" fitHeight="23.0" fitWidth="23.0" layoutX="55.0" layoutY="137.0" onMouseClicked="#favoritesClicked" pickOnBounds="true" preserveRatio="true"&gt;
        &lt;image&gt;
          &lt;Image url="@../images/favorite.png" /&gt;
        &lt;/image&gt;
      &lt;/ImageView&gt;
      &lt;PasswordField fx:id="passwordBox" layoutX="14.0" layoutY="103.0" prefWidth="175.0" promptText="Optional" /&gt;
    &lt;/children&gt;
    &lt;stylesheets&gt;
      &lt;URL value="@style.css" /&gt;
    &lt;/stylesheets&gt;
  &lt;/AnchorPane&gt;
  </code></pre>