public void save() {
				
				//---Enables the users to save the canvas image buffer to file
				 if(canvas._changesMade)
				 if(fileName == null || fileName.isEmpty())
				 {
					 //final JFileChooser sFile = new JFileChooser();
				 
					 int response = fileChooser.showSaveDialog(canvas);
					 if(response == JFileChooser.APPROVE_OPTION)
					 {
						 fileName = fileChooser.getSelectedFile().getAbsolutePath();
						 //checkFileExtension(fileName);
					 }
				 }
			        File file = new File(fileName);
			        String suffix = fileName.substring(fileName.lastIndexOf('.') + 1);
			
			        // png files
			        if (suffix.toLowerCase().equals("png")) {
			            try 
			            { 
			            	ImageIO.write(canvas._bufImage, suffix, file); 
			            	
			            }
			            catch (IOException e) 
			            { 
			            	e.printStackTrace(); 
			            }
			        }
			
			        else if (suffix.toLowerCase().equals("jpg")) {
			            WritableRaster raster = canvas._bufImage.getRaster();
			            WritableRaster newRaster;
			            newRaster = raster.createWritableChild(0, 0, canvas.getWidth(), canvas.getHeight(), 0, 0, null);
			            DirectColorModel cm = (DirectColorModel) canvas._bufImage.getColorModel();
			            DirectColorModel newCM = new DirectColorModel(cm.getPixelSize(),
			                                                          cm.getRedMask(),
			                                                          cm.getGreenMask(),
			                                                          cm.getBlueMask());
			            BufferedImage rgbBuffer = new BufferedImage(newCM, newRaster, false,  null);
			            try { ImageIO.write(rgbBuffer, suffix, file); }
			            catch (IOException e) { e.printStackTrace(); }
			            canvas.setChangesMade(false);
			        }
			
			        else 
			        {
			        	WritableRaster raster = canvas._bufImage.getRaster();
			            WritableRaster newRaster;
			            newRaster = raster.createWritableChild(0, 0, canvas.getWidth(), canvas.getHeight(), 0, 0, null);
			            DirectColorModel cm = (DirectColorModel) canvas._bufImage.getColorModel();
			            DirectColorModel newCM = new DirectColorModel(cm.getPixelSize(),
			                                                          cm.getRedMask(),
			                                                          cm.getGreenMask(),
			                                                          cm.getBlueMask());
			            BufferedImage rgbBuffer = new BufferedImage(newCM, newRaster, false,  null);
			            try 
			            { 
			            	file = new File(fileName.concat(".jpg"));
			            	ImageIO.write(rgbBuffer, "jpg", file);
			            	
			            	
			            }
			            catch (IOException e) { e.printStackTrace(); }
			            //JOptionPane.showMessageDialog(canvas, "Only (*.jpg) and (*.png) files allowed.", "Error saving file", JOptionPane.ERROR_MESSAGE);
			            //fileName = null;
			            canvas.setChangesMade(false);
			        }
				 
		    }//end save