private void OpenbuttonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_OpenbuttonMouseClicked
        // TODO add your handling code here:
        int returnVal = filechooser.showOpenDialog(this);
        if(returnVal==JFileChooser.APPROVE_OPTION){
                        
            outfile=filechooser.getSelectedFile();            
            directory=outfile.getParent();
            filename=outfile.getName();
            filename=filename.substring(0,filename.indexOf('.'));
            mm.clearmemory();
            mm.setDumpfile(directory, filename);
            OutFileDirectory.setText(directory);
            outfileName.setText(filename);
            try {
                FileReader fr=new FileReader(outfile);
                BufferedReader br=new BufferedReader(fr);
                String s="",temp="";
                while(temp!=null){
                    s+=temp+"\n";
                    temp=br.readLine();                
               }
                s=s.trim();
               System.out.println(s);           
               editorarea.setText(s);
               
            } catch (FileNotFoundException ex) {
                Logger.getLogger(MIPS16Window.class.getName()).log(Level.SEVERE, null, ex);
            }
            catch (IOException ex) {
                Logger.getLogger(MIPS16Window.class.getName()).log(Level.SEVERE, null, ex);
            }
            mm.setInfile(directory, filename);    
            logfile=new File(directory,filename+".log");
            
        }else{
            
        }
        
    }//GEN-LAST:event_OpenbuttonMouseClicked