private void readPatternFiles(){
		try {
			systemPatterns = null;
			InputStream sysPatternStream = getClass().getResourceAsStream("/patterns.xml");
			Reader rdr;
			rdr = new InputStreamReader(sysPatternStream, "UTF-8");
			systemPatterns = readFile(rdr);
			rdr.close();
			
		} catch (UnsupportedEncodingException e) {
			JOptionPane.showMessageDialog(null, "Failed to load system pattern file.\n"+e.getMessage());
		} catch (PatternFormatException e) {
			JOptionPane.showMessageDialog(null, "System pattern file is corrupted.\n"+e.getMessage());
		} catch (IOException e) {
			JOptionPane.showMessageDialog(null, "Failed to load system pattern file.\n"+e.getMessage());
		}
		try {

			userPatterns = null;
			File userPatternsFile = new File("user-patterns.xml");
			if (userPatternsFile.exists()){
				FileInputStream userPatternStream = new FileInputStream(userPatternsFile);
				Reader rdr = new InputStreamReader(userPatternStream, "UTF-8");
				userPatterns = readFile(rdr);
				rdr.close();
			}
			
		} catch (UnsupportedEncodingException e) {
			JOptionPane.showMessageDialog(null, "Failed to load user pattern file.\n"+e.getMessage());
		} catch (PatternFormatException e) {
			JOptionPane.showMessageDialog(null, "System pattern file is corrupted.\n"+e.getMessage());
		} catch (IOException e) {
			JOptionPane.showMessageDialog(null, "Failed to load system pattern file.\n"+e.getMessage());
		}
	
	}