title: JTabbedPane what difference between addTab and add
body: <p>i solve problem when i make simple code one by hand and 2nd with GUI builder NetBeans and that created with Netbeans doesnt work that way i want. on attached screenshot is how my app looks.<a href="http://postimg.org/image/6c00csqjn/" rel="nofollow noreferrer">http://postimg.org/image/6c00csqjn/</a> it work when i switch tabs,equation in MathML will render with JEuclid library in case when i write the code handly. </p>
  
  <p>but when i do the same in NetBeans, do gui with builder and write render code to action events generated with netbeans, then the code doesnt work and nothing render. please can somebody tell me where is bug? in NetBeans i found only that Netbeans is using .addTab to JTabbedPane and not .add as do I. app code is bellow. </p>
  
  <p>thank you for any answer</p>
  
  <p><img src="https://i.stack.imgur.com/jO602.png" alt="enter image description here"></p>
  
  <pre><code>import java.awt.BorderLayout;
  import java.awt.Container;
  import javax.swing.JFrame;
  import javax.swing.JPanel;
  import javax.swing.JScrollPane;
  import javax.swing.JSpinner;
  import javax.swing.JTabbedPane;
  import javax.swing.JTextArea;
  import javax.swing.event.ChangeEvent;
  
  import net.sourceforge.jeuclid.swing.JMathComponent;
  
  public class MathMLTabbed extends JFrame{
      private JTextArea formulaSource;
  private JPanel drawingArea, editorArea;
      private JSpinner spinner;
      private JTabbedPane zalozky;
  
  public MathMLTabbed() {
      this.setTitle("MathML Example");
      this.setSize(500, 500);
              setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
      Container content = getContentPane();               
  
      this.formulaSource = new JTextArea();
      editorArea = new JPanel();
      editorArea.setLayout(new BorderLayout());
      editorArea.add(new JScrollPane(this.formulaSource),BorderLayout.CENTER);
              editorArea.add(spinner = new JSpinner(),BorderLayout.NORTH);
              spinner.setValue(18);
  
              drawingArea = new JPanel();
  
              zalozky = new JTabbedPane();
              zalozky.addTab("MathML vstup", editorArea);
              zalozky.addTab("Vzorec", new JScrollPane(drawingArea));
      content.add(zalozky);
  
      zalozky.addChangeListener(new javax.swing.event.ChangeListener() {
  
                  @Override
                  public void stateChanged(ChangeEvent e) {
                      if(zalozky.getSelectedIndex() == 0)
                          drawingArea.removeAll();
                      if(zalozky.getSelectedIndex() == 1)
                          render();
                  }
              });
  
              String retezec = "&lt;?xml version=\"1.0\"?&gt;\r\n" +
                       "&lt;!DOCTYPE math PUBLIC \"-//W3C//DTD MathML 2.0//EN\" \"http://www.w3.org/TR/MathML2/dtd/mathml2.dtd\"&gt;\r\n" +
                       "&lt;math mode=\"display\"&gt;\r\n" +
                       "  &lt;mrow&gt;\r\n" +
                       "    &lt;munderover&gt;\r\n" +
                       "      &lt;mo&gt;&amp;#x222B;&lt;/mo&gt;\r\n" +
                       "      &lt;mn&gt;1&lt;/mn&gt;\r\n" +
                       "      &lt;mi&gt;x&lt;/mi&gt;\r\n" +
                       "    &lt;/munderover&gt;\r\n" +
                       "    &lt;mfrac&gt;\r\n" +
                       "      &lt;mi&gt;dt&lt;/mi&gt;\r\n" +
                       "      &lt;mi&gt;t&lt;/mi&gt;\r\n" +
                       "    &lt;/mfrac&gt;\r\n" +
                       "  &lt;/mrow&gt;\r\n" +
                       "&lt;/math&gt;";
  
              formulaSource.setText(retezec);
  }
  
      public void render() {      
          // get the text
          String latex = formulaSource.getText();         
          // create a formula
          JMathComponent formula = new JMathComponent();                       
                      drawingArea.add(formula);
                      formula.setFontSize((int)spinner.getValue());
                      formula.setContent(latex);
  
  
  
  }
  
      public static void main(String[] args) {
      MathMLTabbed frame = new MathMLTabbed();        
      frame.setVisible(true);}      
  }
  </code></pre>