title: Matlab Custom Rich Text Editor
body: <p>The following code creates a GUI with a rich text editor in Matlab (this is all undocumented features):</p>
  <pre>
  hFig = figure();
  jCodePane = com.mathworks.widgets.SyntaxTextPane;
  codeType = com.mathworks.widgets.text.mcode.MLanguage.M_MIME_TYPE;
  jCodePane.setContentType(codeType)
  jCodePane.setText('')
  jScrollPane = com.mathworks.mwswing.MJScrollPane(jCodePane);
  [jhPanel,hContainer] = javacomponent(jScrollPane,[10,10,300,100],hFig);
  hContainer.Units = 'normalized';
  hContainer.Position = [0 0 1 1];
  </pre>
  <p>As you can see in the screenshot below, when you type in the editor the text is formatted in Matlab style, this comes from the <code>com.mathworks.widgets.text.mcode.MLanguage.M_MIME_TYPE</code> command:</p>
  <p><a href="https://i.stack.imgur.com/tYsfu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tYsfu.png" alt="enter image description here" /></a></p>
  <p>Does anyone know how to have a custom formatting?  e.g. underline certain words, or bold etc....</p>
  <p>The aim is to have a GUI where the user enters text and we could spell check it and highlight incorrect spelling (using a predefined dictionary).</p>