title: Eclipse JSwing Calculator
body: <p>I'm trying to make a calculator using the JSwing api. Ive made It about halfway through, got the calculator so that it was mostly functional, but when I was rearranging some code to make it neater as well as add some new options to the calculator, but I ran into an issue. When I ran it, the formatting of the calculator was all wrong, but the source hadnt been edited. When I tried to change it with the GUI, the window builder spat out an error. </p>
  
  <p>Here is the code that I am working with:</p>
  
  <pre><code>        package calculators;
  
         import java.awt.BorderLayout;
         import java.awt.EventQueue;
  
         import javax.swing.Box;
         import javax.swing.JFrame;
         import javax.swing.JPanel;
         import javax.swing.border.EmptyBorder;
         import javax.swing.JButton;
  
         import java.awt.event.ActionListener;
         import java.awt.event.ActionEvent;
         import java.awt.event.ItemEvent;
         import java.awt.event.ItemListener;
  
         import javax.swing.JTextField;
         import javax.swing.JLabel;
  
         import java.awt.FlowLayout;
  
         import net.miginfocom.swing.MigLayout;
  
         import javax.swing.GroupLayout;
         import javax.swing.GroupLayout.Alignment;
  
         import java.awt.Component;
  
         import javax.swing.LayoutStyle.ComponentPlacement;
         import javax.swing.SwingConstants;
         import javax.swing.JDesktopPane;
  
         import org.eclipse.wb.swing.FocusTraversalOnArray;
  
         import javax.swing.JSeparator;
  
         import java.awt.Color;
  
         import javax.swing.JCheckBox;
         import javax.swing.JRadioButton;
         import javax.swing.border.TitledBorder;
         import javax.swing.JSpinner;
         import javax.swing.SpinnerNumberModel;
  
         import java.awt.Font;
  
  
  
  private JPanel contentPane;
      private JTextField textField; 
      JButton button0;
      JButton button1;
      JButton button2;
      JButton button3;
      JButton button4;
      JButton button5;
      JButton button6;
      JButton button7;
      JButton button8;
      JButton button9;
      JButton addNumbers;
      JButton subNumbers;
      JButton multNumbers;
      JButton divNumbers;
      JButton equalTo;
      JButton clearAll;
      JCheckBox integerMode;
  
  
      /**
       * Launch the application.
       */
      public static void main(String[] args) {
          EventQueue.invokeLater(new Runnable() {
              public void run() {
                  try {
                      LiLCalculator frame = new LiLCalculator();
                      frame.setVisible(true);
                  } catch (Exception e) {
                      e.printStackTrace();
                  }
              }
          });
      }
  
      /**
       * Create the frame.
       */
      public LiLCalculator() {
  
  
          setTitle("Lil Calculator");
  
          JSeparator separator = new JSeparator();
          separator.setOrientation(SwingConstants.VERTICAL);
          separator.setForeground(Color.BLACK);
          separator.setVisible(false);
  
  
          JPanel panel = new JPanel();
          panel.setBorder(new TitledBorder(null, "Precision", TitledBorder.LEADING, TitledBorder.TOP, null, null));
          panel.setVisible(false);
  
          JButton okButton = new JButton("&lt;&lt;&lt;&lt;OK");
          okButton.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent arg0) {
              }
          });
  
  
          setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          setBounds(100, 100, 470, 300);
          contentPane = new JPanel();
          contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
          setContentPane(contentPane);
  
          textField = new JTextField();
          textField.setEditable(false);
          textField.setHorizontalAlignment(SwingConstants.RIGHT);
          textField.setText("0");
          textField.setColumns(10);
  
          JLabel label = new JLabel("");
  
          button1 = new JButton("1");
          button1.setFont(new Font("Tahoma", Font.PLAIN, 9));
          button1.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent arg0) {
                   if(LiLCalculations.firstDigit()){
                       textField.setText("1");
                       LiLCalculations.setFirstDigit(false);
                   } else
                       textField.setText(textField.getText() + "1");
              }
          });
  
          button2 = new JButton("2");
          button2.setFont(new Font("Tahoma", Font.PLAIN, 9));
          button2.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent arg0) {
                   if(LiLCalculations.firstDigit()){
                       textField.setText("2");
                       LiLCalculations.setFirstDigit(false);
                   } else
                       textField.setText(textField.getText() + "2");
              }
          });
  
          button4 = new JButton("4");
          button4.setFont(new Font("Tahoma", Font.PLAIN, 9));
          button4.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent arg0) {
                   if(LiLCalculations.firstDigit()){
                       textField.setText("4");
                       LiLCalculations.setFirstDigit(false);
                   } else
                       textField.setText(textField.getText() + "4");
              }
          });
  
          button5 = new JButton("5");
          button5.setFont(new Font("Tahoma", Font.PLAIN, 9));
          button5.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent arg0) {
                   if(LiLCalculations.firstDigit()){
                       textField.setText("5");
                       LiLCalculations.setFirstDigit(false);
                   } else
                       textField.setText(textField.getText() + "5");
              }
          });
  
          button3 = new JButton("3");
          button3.setFont(new Font("Tahoma", Font.PLAIN, 9));
          button3.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent arg0) {
                   if(LiLCalculations.firstDigit()){
                       textField.setText("3");
                       LiLCalculations.setFirstDigit(false);
                   } else
                       textField.setText(textField.getText() + "3");
              }
          });
  
          button6 = new JButton("6");
          button6.setFont(new Font("Tahoma", Font.PLAIN, 9));
          button6.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent arg0) {
                   if(LiLCalculations.firstDigit()){
                       textField.setText("6");
                       LiLCalculations.setFirstDigit(false);
                   } else
                       textField.setText(textField.getText() + "6");
              }
          });
  
          button7 = new JButton("7");
          button7.setFont(new Font("Tahoma", Font.PLAIN, 9));
          button7.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent arg0) {
                   if(LiLCalculations.firstDigit()){
                       textField.setText("7");
                       LiLCalculations.setFirstDigit(false);
                   } else
                       textField.setText(textField.getText() + "7");
              }
          });
  
          button8 = new JButton("8");
          button8.setFont(new Font("Tahoma", Font.PLAIN, 9));
          button8.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent arg0) {
                   if(LiLCalculations.firstDigit()){
                       textField.setText("8");
                       LiLCalculations.setFirstDigit(false);
                   } else
                       textField.setText(textField.getText() + "8");
              }
          });
  
          button9 = new JButton("9");
          button9.setFont(new Font("Tahoma", Font.PLAIN, 9));
          button9.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent arg0) {
                   if(LiLCalculations.firstDigit()){
                       textField.setText("9");
                       LiLCalculations.setFirstDigit(false);
                   } else
                       textField.setText(textField.getText() + "9");
              }
          });
  
          button0 = new JButton("0");
          button0.setFont(new Font("Tahoma", Font.PLAIN, 9));
          button0.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent arg0) {
                   if(LiLCalculations.firstDigit()){
                       textField.setText("0");
                       LiLCalculations.setFirstDigit(false);
                   } else
                       textField.setText(textField.getText() + "0");
              }
          });
  
          subNumbers = new JButton("-");
          subNumbers.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent arg0) {
                  long x = Long.parseLong(textField.getText());
                  LiLCalculations.setFirstDigit(true);
                  LiLCalculations.setCalcSelect(2);
                  LiLCalculations.setFirstNumber(x);
  
              }
          });
  
          divNumbers = new JButton("/");
          divNumbers.setFont(new Font("Tahoma", Font.PLAIN, 9));
          divNumbers.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent arg0) {
  
                      long x = Long.parseLong(textField.getText());
                      button0.setEnabled(false);
                      LiLCalculations.setFirstDigit(true);
                      LiLCalculations.setCalcSelect(4);
                      LiLCalculations.setFirstNumber(x);
  
              }
          });
  
          addNumbers = new JButton("+");
          addNumbers.setFont(new Font("Tahoma", Font.PLAIN, 8));
          addNumbers.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent arg0) {
                  long x = Long.parseLong(textField.getText());
                  LiLCalculations.setFirstDigit(true);
                  LiLCalculations.setCalcSelect(1);
                  LiLCalculations.setFirstNumber(x);
              }
          });
  
          multNumbers = new JButton("*");
          multNumbers.setFont(new Font("Tahoma", Font.PLAIN, 9));
          multNumbers.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent arg0) {
                  long x = Long.parseLong(textField.getText());
                  LiLCalculations.setFirstDigit(true);
                  LiLCalculations.setCalcSelect(3);
                  LiLCalculations.setFirstNumber(x);
  
              }
          });
  
          equalTo = new JButton("=");
          equalTo.setFont(new Font("Tahoma", Font.PLAIN, 9));
          equalTo.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent arg0) {     
                  long y = Long.parseLong(textField.getText());
                  long z = LiLCalculations.getFirstNumber();
                  long ans = LiLCalculations.result(y, z);
                  textField.setText(Long.toString(ans));
                  LiLCalculations.setFirstDigit(true);    
  
  
              }
          });
  
  
  
          clearAll = new JButton("Clear All");
          clearAll.setFont(new Font("Tahoma", Font.PLAIN, 9));
          clearAll.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent arg0) {
                  textField.setText("0");
                  LiLCalculations.setFirstDigit(true);
              }
          });
  
          JButton optionSelect = new JButton("Options");
          optionSelect.setFont(new Font("Tahoma", Font.PLAIN, 9));
          optionSelect.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent arg0) {
                  optionSelect.setEnabled(false);
  
              }
          });
  
          JButton negativeNumbers = new JButton("+/-");
          negativeNumbers.setFont(new Font("Tahoma", Font.PLAIN, 9));
          negativeNumbers.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent arg0) {
                  long x = Long.parseLong(textField.getText());
                  x = x * -1;
                  textField.setText(Long.toString(x));
              }
          });
  
  
          JRadioButton twoDecimalPlaces = new JRadioButton("2");
          panel.add(twoDecimalPlaces);
          panel.setVisible(false);
          twoDecimalPlaces.setVisible(false);
  
          JRadioButton fourDecimalPlaces = new JRadioButton("4");
          fourDecimalPlaces.setSelected(true);
          panel.add(fourDecimalPlaces);
          fourDecimalPlaces.setVisible(false);
  
          JRadioButton otherRadio = new JRadioButton("Other");
          panel.add(otherRadio);
          otherRadio.setVisible(false);
  
          GroupLayout gl_contentPane = new GroupLayout(contentPane);
          JButton decimalPoint = new JButton(".");
          decimalPoint.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                  if(integerMode.isSelected() == true){
                      decimalPoint.disable();
                  } else {
                      double x = Double.parseDouble(textField.getText());
                      if(LiLCalculations.firstDigit() == true){
                          textField.setText("." + Double.toString(x));
                      } else {
                          textField.setText( Double.toString(x) + ".");
                      }
                      decimalPoint.disable();
                  }
  
              }
          });
  
          JCheckBox integerMode = new JCheckBox("Integer Arithmetic", true);
          integerMode.addItemListener(new ItemListener(){
  
              @Override
              public void itemStateChanged(ItemEvent e) {
                  if(e.getSource() == integerMode){
  
                      if(integerMode.isSelected() == false){
  
                          JSpinner spinner = new JSpinner();
                          spinner.setVisible(false);
                          spinner.setModel(new SpinnerNumberModel(0, 0, 10, 1));
                          panel.add(spinner);
                          contentPane.setLayout(gl_contentPane);  
                          setFocusTraversalPolicy(new FocusTraversalOnArray(new Component[]{contentPane, button1, button2, button3, 
                                  button4, button5, button6, button7, button8, button9, 
                                  button0, decimalPoint, addNumbers, subNumbers, multNumbers, divNumbers, 
                                  equalTo, negativeNumbers, clearAll, optionSelect, textField}));
  
  
                          otherRadio.setVisible(true);
                          panel.setVisible(true);
                          fourDecimalPlaces.setVisible(true);
                          twoDecimalPlaces.setVisible(true);
                          otherRadio.setVisible(true);
                      }
  
                  }
  
              }
  
          });
  
  
          gl_contentPane.setHorizontalGroup(
              gl_contentPane.createParallelGroup(Alignment.LEADING)
                  .addGroup(gl_contentPane.createSequentialGroup()
                      .addContainerGap()
                      .addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING, false)
                          .addComponent(textField)
                          .addGroup(gl_contentPane.createSequentialGroup()
                              .addGroup(gl_contentPane.createParallelGroup(Alignment.TRAILING)
                                  .addComponent(button1, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE)
                                  .addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
                                      .addGroup(gl_contentPane.createParallelGroup(Alignment.TRAILING)
                                          .addComponent(button7, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE)
                                          .addComponent(button4, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE))
                                      .addComponent(decimalPoint, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE)))
                              .addPreferredGap(ComponentPlacement.RELATED)
                              .addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING, false)
                                  .addGroup(gl_contentPane.createSequentialGroup()
                                      .addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
                                          .addComponent(button5, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE)
                                          .addComponent(button2, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE))
                                      .addPreferredGap(ComponentPlacement.RELATED)
                                      .addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
                                          .addComponent(button3, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE)
                                          .addComponent(button6, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE)))
                                  .addGroup(gl_contentPane.createSequentialGroup()
                                      .addComponent(button8, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE)
                                      .addPreferredGap(ComponentPlacement.RELATED)
                                      .addComponent(button9, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE))
                                  .addComponent(button0, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                              .addPreferredGap(ComponentPlacement.RELATED)
                              .addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
                                  .addComponent(subNumbers, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE)
                                  .addComponent(multNumbers, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE)
                                  .addComponent(divNumbers, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE)
                                  .addComponent(addNumbers, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE))
                              .addPreferredGap(ComponentPlacement.RELATED)
                              .addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING, false)
                                  .addComponent(negativeNumbers, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                  .addComponent(equalTo, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                  .addComponent(clearAll, GroupLayout.DEFAULT_SIZE, 86, Short.MAX_VALUE)
                                  .addComponent(optionSelect, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                      .addGap(18)
                      .addComponent(separator, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                      .addPreferredGap(ComponentPlacement.UNRELATED)
                      .addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
                          .addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING, false)
                              .addComponent(integerMode, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                              .addComponent(okButton, GroupLayout.PREFERRED_SIZE, 86, GroupLayout.PREFERRED_SIZE))
                          .addComponent(panel, 0, 0, Short.MAX_VALUE))
                      .addContainerGap())
          );
          gl_contentPane.setVerticalGroup(
              gl_contentPane.createParallelGroup(Alignment.LEADING)
                  .addGroup(gl_contentPane.createSequentialGroup()
                      .addGap(18)
                      .addComponent(textField, GroupLayout.PREFERRED_SIZE, 28, GroupLayout.PREFERRED_SIZE)
                      .addGap(3)
                      .addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE)
                          .addComponent(button1, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE)
                          .addComponent(button2, GroupLayout.DEFAULT_SIZE, 40, Short.MAX_VALUE)
                          .addComponent(button3, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE)
                          .addComponent(addNumbers, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE)
                          .addComponent(negativeNumbers, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE))
                      .addPreferredGap(ComponentPlacement.RELATED)
                      .addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE)
                          .addComponent(button6, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE)
                          .addComponent(button5, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE)
                          .addComponent(button4, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE)
                          .addComponent(subNumbers, GroupLayout.DEFAULT_SIZE, 40, Short.MAX_VALUE)
                          .addComponent(equalTo, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE))
                      .addPreferredGap(ComponentPlacement.RELATED)
                      .addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE)
                          .addComponent(button7, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE)
                          .addComponent(button8, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE)
                          .addComponent(button9, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE)
                          .addComponent(multNumbers, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE)
                          .addComponent(optionSelect, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE))
                      .addPreferredGap(ComponentPlacement.RELATED)
                      .addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE)
                          .addComponent(decimalPoint, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE)
                          .addComponent(button0, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE)
                          .addComponent(divNumbers, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE)
                          .addComponent(clearAll, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE))
                      .addGap(25))
                  .addGroup(gl_contentPane.createSequentialGroup()
                      .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                      .addComponent(separator, GroupLayout.PREFERRED_SIZE, 241, GroupLayout.PREFERRED_SIZE)
                      .addContainerGap())
                  .addGroup(gl_contentPane.createSequentialGroup()
                      .addGap(29)
                      .addComponent(integerMode)
                      .addGap(18)
                      .addComponent(panel, GroupLayout.PREFERRED_SIZE, 110, GroupLayout.PREFERRED_SIZE)
                      .addGap(26)
                      .addComponent(okButton, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE)
                      .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
          );
  
  
      }
  </code></pre>
  
  <p>Here is the error that I've gotten from the window viewer:</p>
  
  <pre><code>``
  Internal Error
  WindowBuilder encountered unexpected internal error. 
  
  This could be caused by a WindowBuilder bug or by a misconfiguration issue, conflict, partial update, etc.
  
  &gt; org.eclipse.wb.internal.core.utils.check.AssertionFailedException:
  &gt; {new: javax.swing.JButton} {local-unique: decimalPoint} {/new
  &gt; JButton(".")/ /decimalPoint.addActionListener(new ActionListener() {
  &gt; public void actionPerformed(ActionEvent e) {
  &gt; if(integerMode.isSelected() == true){ decimalPoint.disable(); } else {
  &gt; double x = Double.parseDouble(textField.getText());
  &gt; if(LiLCalculations.firstDigit() == true){ textField.setText("." +
  &gt; Double.toString(x)); } else { textField.setText( Double.toString(x) +
  &gt; "."); } decimalPoint.disable(); } } })/} is not created at after
  &gt; GroupLayout gl_contentPane=new GroupLayout(contentPane); in package
  &gt; calculators; import java.awt.BorderLayout; import java.awt.EventQueue;
  &gt; import javax.swing.Box; import javax.swing.JFrame; import
  &gt; javax.swing.JPanel; import javax.swing.border.EmptyBorder; import
  &gt; javax.swing.JButton; import java.awt.event.ActionListener; import
  &gt; java.awt.event.ActionEvent; import java.awt.event.ItemEvent; import
  &gt; java.awt.event.ItemListener; import javax.swing.JTextField; import
  &gt; javax.swing.JLabel; import java.awt.FlowLayout; import
  &gt; net.miginfocom.swing.MigLayout; import javax.swing.GroupLayout; import
  &gt; javax.swing.GroupLayout.Alignment; import java.awt.Component; import
  &gt; javax.swing.LayoutStyle.ComponentPlacement; import
  &gt; javax.swing.SwingConstants; import javax.swing.JDesktopPane; import
  &gt; org.eclipse.wb.swing.FocusTraversalOnArray; import
  &gt; javax.swing.JSeparator; import java.awt.Color; import
  &gt; javax.swing.JCheckBox; import javax.swing.JRadioButton; import
  &gt; javax.swing.border.TitledBorder; import javax.swing.JSpinner; import
  &gt; javax.swing.SpinnerNumberModel; import java.awt.Font; public class
  &gt; LiLCalculator extends JFrame { private JPanel contentPane; private
  &gt; JTextField textField; JButton button0; JButton button1; JButton
  &gt; button2; JButton button3; JButton button4; JButton button5; JButton
  &gt; button6; JButton button7; JButton button8; JButton button9; JButton
  &gt; addNumbers; JButton subNumbers; JButton multNumbers; JButton
  &gt; divNumbers; JButton equalTo; JButton clearAll; JCheckBox integerMode;
  &gt; /** * Launch the application. */ public static void main(String[]
  &gt; args) { EventQueue.invokeLater(new Runnable() { public void run() {
  &gt; try { LiLCalculator frame = new LiLCalculator();
  &gt; frame.setVisible(true); } catch (Exception e) { e.printStackTrace(); }
  &gt; } }); } /** * Create the frame. */ public LiLCalculator() {
  &gt; setTitle("Lil Calculator"); JSeparator separator = new JSeparator();
  &gt; separator.setOrientation(SwingConstants.VERTICAL);
  &gt; separator.setForeground(Color.BLACK); separator.setVisible(false);
  &gt; JPanel panel = new JPanel(); panel.setBorder(new TitledBorder(null,
  &gt; "Precision", TitledBorder.LEADING, TitledBorder.TOP, null, null));
  &gt; panel.setVisible(false); JButton okButton = new JButton("&lt;&lt;&lt; ``
  </code></pre>
  
  <p>I would post a picture of how I wanted my calculators model to look vs how it looks now, but I do not have enough reputation, but I want to know why the calculators components are ignoring my instructions and just appearing in a straight line. Also, I would like to know if someone knows what this error is? I have had to restart eclipse several times because of errors with the Window builder and want to know what I can do to fix it. Thank you very much.</p>
  
  <p>(If needed, I can post the full stack error and Im actually not sure how to format my error like code, so would it be possible for someone to edit it so that it looks like its in a code block?)</p>
  
  <p>EDIT: May I ask why the question is being downvoted?</p>