public static void updateSelectedRow(JTable table, Container controlsContainer) throws Exception {
        int selRow = table.getSelectedRow();
        DefaultTableModel tableModel = ((DefaultTableModel)table.getModel());

        if (selRow > -1) {
            int compCount = controlsContainer.getComponentCount();
            int column = 0;
            Object value = null;
            Component comp;
            String item;
            StringBuffer newItem;
            JComboBox comboBox;

            for (int i = 0; i < compCount; i++) {
                comp = controlsContainer.getComponent(i);
                if (!(comp instanceof JLabel)) {
                    if ((comp instanceof JTextField)) {
                        value = ((JTextField)comp).getText();
                    } else if (comp instanceof JToggleButton) {
                        value = new Boolean(((JToggleButton)comp).isSelected());
                    } else if (comp instanceof JComboBox) {
                        comboBox = (JComboBox)comp;
                        item = (String)comboBox.getSelectedItem();
                        if (item.indexOf(DELIMETER) > -1) {
                            //Moves the second value from the table to the combobox.
                            newItem = new StringBuffer();
                            newItem.append(tableModel.getValueAt(selRow, 0));
                            newItem.append(DELIMETER);
                            newItem.append(tableModel.getValueAt(selRow, 1));
                            comboBox.addItem(newItem.toString());
                            //Moves the first value from the combobox to the table.
                            comboBox.removeItem(item);
                            tableModel.setValueAt(item.substring(0, item.indexOf(DELIMETER)), selRow, 0);
                            tableModel.setValueAt(item.substring(item.indexOf(DELIMETER) + DELIMETER.length()), selRow, 1);
                            return;
                        } else {
                            value = item;
                        }
                    }

                    tableModel.setValueAt(value, selRow, column);
                    column++;
                }
            }
        }
    }