title: Place cursor on next line when semi-colon is pressed
body: <p>When a user presses the semi-colon key, I would like the semi-colon to stay on the same line but the move the cursor down. For example,</p>
  <p><strong>What I want</strong></p>
  <blockquote>
  <p>example text;  &lt;-- semi-colon been pressed and entered</p>
  <p>| &lt;--- cursor moved to here</p>
  </blockquote>
  <p>My present code, the semi colon moves down and the cursor is placed next to it, like so:</p>
  <p><strong>What I have</strong></p>
  <blockquote>
  <p>example text</p>
  <p>;| &lt;-- cursor and semi-colon go to a new line</p>
  </blockquote>
  <p>Thank you.</p>
  <p><strong>SSCCE</strong>:</p>
  <pre><code>import java.awt.Font;
  import javax.swing.InputMap;
  import javax.swing.JFrame;
  import javax.swing.JTextPane;
  import javax.swing.KeyStroke;
  import javax.swing.WindowConstants;
  
  public class Example {
  
  private final JFrame frame = new JFrame();
  private final JTextPane editor = new JTextPane();
  
  public Example() {
      frameStuff();
      newLineOnSemiColonPress();
  }
  
  private void newLineOnSemiColonPress() {
      InputMap input = editor.getInputMap();
      String INSERT_BREAK = &quot;insert-break&quot;;
      KeyStroke semi = KeyStroke.getKeyStroke(&quot;SEMICOLON&quot;);
      input.put(semi, INSERT_BREAK);
  }
  
  private void frameStuff() {
      editor.setFont(new Font(&quot;Arial&quot;, 0, 13));
      frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
      frame.setSize(new Dimension(500, 400));
      frame.getContentPane().add(editor);
      frame.setVisible(true);
  }
  
  public static void main(String[] args) {
      new Example();
  }
  }
  </code></pre>