public void fileNew(SimpleFrame frame) 
	{
		frame.setAction(false);
		frame.setIsFileNameSetted(false);
		frame.setTitle("Text Editor");
		JFileChooser chooser = new JFileChooser();
		
		if(frame.getIsChanged()) 
		{
			int selection = JOptionPane.showConfirmDialog(null,"Do you want save document?", "Warrning", JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE);
			
			if(selection == JOptionPane.NO_OPTION)	
			{
				frame.getText().setText("");
				frame.setIsChanged(false);
				frame.setTitle("Text Editor");
			}
			
			if(selection == JOptionPane.YES_OPTION)
			{
				chooser.setCurrentDirectory(new File("."));
				
				int result = chooser.showSaveDialog(null);
				if (result == JFileChooser.APPROVE_OPTION)
				{
					frame.fileName = chooser.getSelectedFile().getPath();
					PrintWriter out;
					try 
					{
						out = new PrintWriter(new FileWriter(frame.fileName));
						String str = frame.getText().getText();
						out.print(str);
						out.close();
					} 
					catch (IOException e) 
					{
						JOptionPane.showMessageDialog(frame, "Saving error");
					}
				}
				frame.getText().setText("");
				frame.setIsChanged(false);
				frame.setTitle("Text Editor");
			}
		}
		else
		{
			frame.getText().setText("");
		}
		frame.setAction(true);
	}