@Override public void removeTabAt(int index) {
        // Checks the component type being removed
        Component component = getComponentAt(index);
        if(component instanceof SourceFileEditor) {
            /* SourceFileEditor panels are checked to ensure their SourceFile is 
             * up to date */
            SourceFileEditor editor = (SourceFileEditor) component;
            if(editor.changesMade()) {
                // Show confirm dialog if need to save changed
                int action = UIUtilities.showConfirmDialog(
                        this, "Save changes to " + editor.getSourceFile().getName());
                switch(action) {
                    case JOptionPane.YES_OPTION :
                        editor.updateFileContents();
                        try {
                            SourceFile.save(editor.getSourceFile());
                        }catch (Exception e) {
                            UIUtilities.showErrorDialog(this, e.getMessage());
                        }
                        
                        break;
                    case JOptionPane.NO_OPTION :
                        break;
                    case JOptionPane.CANCEL_OPTION :
                        // Cancel - don't remove tab
                        return;
                }
            }
        }
        
        super.removeTabAt(index);
    }