title: Autoresizing JtextPane after Font Size Change
body: <p>I load a text in a <code>JTextPane</code> and automatically every line takes the max number of words it can. When I decrease the <code>Font</code> size text just zoom out and all lines are half empty. How can I auto resize the text so every line is filled no matter what size of <code>Font</code> I use?
  The code for changing font is </p>
  
  <pre><code>JComboBox cb =(JComboBox)evt.getSource();
  String Selection =(String)cb.getSelectedItem();
  int n = Integer.parseInt(Selection);
  Font font = new Font("Monospaced", Font.PLAIN, n);
          editPane.setFont(font);
  </code></pre>