private void readFromFile() throws Exception{
        FileReader fr = null;
        try{
            
            fr = new FileReader(fileName);
            BufferedReader br = new BufferedReader(fr);
            String s;
            text = new StringBuffer();
            while((s = br.readLine()) != null){
                if(text.length() != 0)
                    text.append("\n");
                text.append(s);                
            }
            
        }catch(FileNotFoundException ex){
            ex.printStackTrace();
        }catch(IOException ex){
            ex.printStackTrace();
        }finally{
            if(fr != null){
                fr.close();
            }
        }
    }