title: How to display HTML in JavaFX Application
body: <p>I am developing a FontViewer application which changes the font of the text based on the selected font style.</p>
  
  <p>This is the controller class of my application</p>
  
  <pre><code>public class FXMLDocumentController implements Initializable {
  
      @FXML
      private ListView fontListView;
  
      @FXML
      private TextArea fontTextArea;
  
      int[] fontSizes = {34, 28, 24, 20, 18, 16, 14, 12, 11, 10, 9, 8, 7, 6};
  
      String fontText = "";
  
      @Override
      public void initialize(URL url, ResourceBundle rb) {
          ObservableList&lt;String&gt; fontsList = FXCollections.observableArrayList(Font.getFontNames());
          fontListView.setItems(fontsList);
      }
  
      @FXML
      public void handleMouseClickEvent(MouseEvent mouseEvent) {
          changeFont();
      }
  
      public void changeFont() {
          for (int i = 0; i &lt; fontSizes.length; i++) {
              fontText += "&lt;p style='font-family:" + fontListView.getSelectionModel().getSelectedItem() + ";font-size:" + fontSizes[i] + "'&gt;" + "This is Sample Text&lt;/p&gt;";
          }
  
          fontTextArea.setText(fontText);
      }
  }
  </code></pre>
  
  <p>Screenshot of my application:</p>
  
  <p><img src="https://i.stack.imgur.com/UdoKB.png" alt="enter image description here"></p>
  
  <p>When I use a <code>TextArea</code>, it displays just the plain HTML code instead of converting the HTML to Text. Which control should I use to accomplish this?</p>
  
  <p>P.S: I tried <code>TextFlow</code> but it doesn't work, as I need to display different Styles and font-sizes for the required text.</p>
  
  <p>I also looked at <code>WebView</code> but didn't understand how it could solve the mentioned problem.</p>