@Override
    public void tableChanged(TableModelEvent e) {
        if ( e.getType() == TableModelEvent.UPDATE ) {
            int row = e.getFirstRow();
            String newName = (String) tableModel.getValueAt(row, 0);
            String newContent = (String) tableModel.getValueAt(row, 1);
            Command command = commands.get(row);
            command.name = newName;
            command.content = newContent;
        }
    }