private Boolean openFile(){

    	/* creates a data backup in case the file is corrupted */
    	m_dataSetBackup = m_dataSet;
    	
    	/* add .csv extension selection to File Chooser 
    	 * m_firstTimeOpen flag ensures that it's added only once
    	 * */
    	if(m_firstTimeOpen) {
            m_firstTimeOpen = false;
            FileFilter extensionFilter = new FileNameExtensionFilter(
            		"CSV Files (.csv)", "csv");
            FILE_CHOOSER.addChoosableFileFilter(extensionFilter);
    	}
    	
    	int returnVal = FILE_CHOOSER.showOpenDialog(DataVisualizerGUI.this);
    	if (returnVal == JFileChooser.APPROVE_OPTION) {
            File m_file = FILE_CHOOSER.getSelectedFile();
            /** instantiate a DataSet object*/
            m_dataSet = new DataSet();
            if(!m_dataSet.BuildDataSet(m_file)){
                /** retrieves the data from backup when the file was 
                 * corrupted */
                m_dataSet = m_dataSetBackup; 
                return false;
                
            } else {	
                /* set buttons to default */
                DisactivateColour();
                m_panel1.removeAll();
                m_panel1.add( new TableView(m_dataSet) );
                m_panel1.repaint();
                m_panel1.revalidate();
                m_tabbedPanel.setSelectedIndex(TABLE_PANEL);

                if (m_firstFileLoaded) {
                	/** create a Chart Setup window when the first file
                	 * is loaded
                	 */
                    m_chart = new ChartGUI(m_dataSet);
                    m_firstFileLoaded = false;
                } else {
                	/** dispose the old Chart Setup window when next file
                	 * is loaded and create a new one
                	 */
                    m_chart.DisposeWindow();
                    m_chart = new ChartGUI(m_dataSet);
                }	
    
                m_panel2.removeAll();
                m_panel2.add(m_chart);
                /** hide the Colour Menu window when the file is loaded */
                m_cm.setVisible(false);
            }
    	} else {
            return false;
    	}
    	return true;
    }