private void jButtonConstruction_CreateLevelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonConstruction_CreateLevelActionPerformed
        String tag = jTextFieldUID.getText();
        if (tag.length() == 0) {
            JOptionPane.showMessageDialog(null, "UID tag required for level\n", "EDUCacheSim: " + "Create configuration", JOptionPane.INFORMATION_MESSAGE);
            return;
        }

        int result = JOptionPane.YES_OPTION;
        if (createdElements.containsKey(tag)) {
            result = JOptionPane.showConfirmDialog(null, "Specified UID exists, replace?", "EDUCacheSim: Create configuration", JOptionPane.YES_NO_OPTION);
        }
        if (result == JOptionPane.NO_OPTION) {
            return;
        }
        ReplacementPolicy rp = getReplacementPolicyChosen();
        try {
            int assoc = Integer.parseInt(jTextFieldAssoc.getText());
            int size = Integer.parseInt(jTextFieldSize.getText());
            int linew = Integer.parseInt(jTextFieldLineW.getText());
            String sizeRange = (String) jComboBoxConstruction_SizeRange.getSelectedItem();
            switch (sizeRange) {
                case "KB":
                    size *= 1024;
                    break;
                case "MB":
                    size *= 1024 * 1024;
                    break;
            }
            if (size < assoc * linew) {
                JOptionPane.showMessageDialog(null, "Cache Size must be at least (LineWidth*Associativity) Bytes\n", "EDUCacheSim: " + "Create configuration", JOptionPane.INFORMATION_MESSAGE);
                return;
            }
            CacheLevel cl = new CacheLevelImpl(tag, rp, size, assoc, linew);
            createdElements.put(tag, cl);
        } catch (NumberFormatException e) {
            JOptionPane.showMessageDialog(null, "Numbers only required in fields Associativity, Size and Line width\n", "EDUCacheSim: " + "Create configuration", JOptionPane.INFORMATION_MESSAGE);
        }
        refreshTable();
    }//GEN-LAST:event_jButtonConstruction_CreateLevelActionPerformed