title: Change the font style, size in a Java swing appliation
body: <p>I am writing an email app with java swing. I want the user to be able to change the font while writing an email, but I am not sure how to do that.
  I created a JComboBox that has all the fonts.</p>
  
  <p>I guess I should use <code>getSelectedItem()</code> so and add an actionListener to the JComboBox to pass this info to the JTextArea? Or there are other ways?
  Here is my code:</p>
  
  <pre><code>String[] fonts = GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames();
  
          JComboBox comboBox = new JComboBox(fonts);// create a combo box with the array
          comboBox.setFont(new Font("Times New Roman", Font.PLAIN, 12));// set the font
          comboBox.setBounds(21, 6, 193, 25);// set size and location
          add(comboBox);
  </code></pre>
  
  <p>How should I make all the text field change the font according to the selected item in the comboBox?</p>