if (selectedFile != null) {
if (selectedFile != null && (retval == jfc.APPROVE_OPTION)) {
	private void importItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_importItemActionPerformed            // Display a file chooser                        File selectedFile;            Model m = null;                        JFileChooser jfc = new JFileChooser( workingDirectory );            jfc.setFileFilter( new FileFilter() {                public boolean accept( File f ) {                    return f.isDirectory() || f.getName().endsWith( ".xmi" );                }                                public String getDescription() {                    return "XMI UML files (*.xmi)";                }            } );                        jfc.setCurrentDirectory( workingDirectory );                        jfc.showDialog( this, "Import" );                        selectedFile = jfc.getSelectedFile();            if (selectedFile != null) {                try {                    m = importModel( selectedFile );                    if (m != null) {                        models.add(m);                        JOptionPane.showMessageDialog( this, "Model loaded successfully.", "Success!",                                JOptionPane.INFORMATION_MESSAGE );                        workingDirectory = jfc.getSelectedFile().getParentFile();                        getContentPane().remove(MTP);                        MTP = new ModelTreePanel(m);                        getContentPane().add(MTP, BorderLayout.CENTER);                        try{                            ObjectOutputStream Out = new ObjectOutputStream(new FileOutputStream(System.getProperty("user.home")+"/"+"WorkSpace.dat"));                            Out.writeObject(new WorkSpace(workingDirectory.getAbsolutePath()));                            Out.close();                        } catch (Exception ex){                            ex.printStackTrace();                        }                                            }                } catch( FileNotFoundException fnfe ) {                    JOptionPane.showMessageDialog( this, "Could not open the model file: " + fnfe.getMessage(),                            "File not found", JOptionPane.ERROR_MESSAGE );                } catch( ParseException pe ) {                    JOptionPane.showMessageDialog( this, "There was an error in parsing the given model: " + pe.getMessage(),                            "Parse error", JOptionPane.ERROR_MESSAGE );                                    } catch( LemException le ) {                    JOptionPane.showMessageDialog( this, "There was an error in parsing the given model: " + le.getMessage(),                            "Parse error", JOptionPane.ERROR_MESSAGE );                } catch( IOException ioe ) {                    JOptionPane.showMessageDialog( this, "An input/output error occured while trying to read the model: " + ioe.getMessage(),                            "Read error", JOptionPane.ERROR_MESSAGE );                } catch( Exception e ) {                    e.printStackTrace();                }                            }                        setVisible(true);	}//GEN-LAST:event_importItemActionPerformed