public void updateGui() {
    // { Remove all components from the ModelPanel
    for (JPanel constraintPanel : this.constraintPanels) {
      constraintPanel.removeAll();
    }
    this.objfuncPanel.removeAll();
    this.removeAll();
    // }

    // { GUI part for the objective-function
    GuiUtil.addComponent(this, objfuncPanel, 0, 0, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER,
        GridBagConstraints.BOTH);
    GuiUtil.addComponent(this.objfuncPanel, new JLabel("f(x) = "), 0, 0, 1, 1, 1.0, 1.0,
        GridBagConstraints.CENTER, GridBagConstraints.BOTH);
    for (int i = 0, j = 1; i < objfuncComponents.size(); i++, j += 2) {
      GuiUtil.addComponent(this.objfuncPanel, objfuncComponents.get(i), j, 0, 1, 1, 1.0, 1.0,
          GridBagConstraints.CENTER, GridBagConstraints.BOTH);
      String lblText = "* X" + i + (i == objfuncComponents.size() - 1 ? "" : " + ");
      GuiUtil.addComponent(this.objfuncPanel, new JLabel(lblText), j + 1, 0, 1, 1, 1.0, 1.0,
          GridBagConstraints.CENTER, GridBagConstraints.BOTH);
    }
    // }

    // { GUI part for the constraints
    // Add constraint panels to the ModelPanel
    for (int i = 0; i < constraintPanels.size(); i++) {
      GuiUtil.addComponent(this, constraintPanels.get(i), 0, i + 1, 1, 1, 1.0, 1.0,
          GridBagConstraints.CENTER, GridBagConstraints.BOTH);
    }

    // Add the components of each constraint panel
    for (int i = 0; i < constraintComponents.size(); i++) {
      for (int j = 0; j < constraintComponents.get(i).size(); j++) {
        GuiUtil.addComponent(this.constraintPanels.get(i),
            this.constraintComponents.get(i).get(j), j, 0, 1, 1, 1.0, 0.0,
            GridBagConstraints.CENTER, GridBagConstraints.BOTH);
      }
    }
    // }

    this.pack();

    updateUI(); // Resets the UI property with a value from the current look and feel
  }