public void save() {
		String savePath =  new Control_GetPath().getStreamRipStarPath();
		XMLOutputFactory outputFactory = XMLOutputFactory.newInstance(); 
		
		try {
			XMLEventWriter writer = outputFactory.createXMLEventWriter(
					new FileOutputStream(savePath+"/Settings-StreamRipStar.xml" ) );
			XMLEventFactory eventFactory = XMLEventFactory.newInstance();
			
			//header for the file
			XMLEvent header = eventFactory.createStartDocument();
			XMLEvent startRootSettings = eventFactory.createStartElement( "", "", "Settings" );

			XMLEvent activeIconCB_S = eventFactory.createAttribute( "activeTrayIcon",  String.valueOf( activeTrayIcon.isSelected()));
			XMLEvent lookAndFeelCB_S = eventFactory.createAttribute( "useAnotherLnfBox",  String.valueOf( useAnotherLnfBox.isSelected()));
			XMLEvent showTextCB_S = eventFactory.createAttribute( "showTextCB", String.valueOf( showTextCheckBox.isSelected()) );
			XMLEvent useInternalAudioPlayerCB_S = eventFactory.createAttribute( "useInternalAudioPlayerCB", String.valueOf( useInternalAudioPlayerCB.isSelected()) );
			XMLEvent ripperPathTF_S = eventFactory.createAttribute( "ripperPathTF", ripperPathField.getText()); 
			XMLEvent shoutcastTF_S = eventFactory.createAttribute( "shoutcastTF", shoutcastPlayer.getText()); 
			XMLEvent generellPathTF_S = eventFactory.createAttribute( "generellPathTF", generellPathField.getText()); 
			XMLEvent fileBrowserTF_S = eventFactory.createAttribute( "fileBrowserTF", fileBrowserField.getText()); 
			XMLEvent webBrowserTF_S = eventFactory.createAttribute( "webBrowserTF", webBrowserField.getText()); 
			XMLEvent statusBox_index = eventFactory.createAttribute( "statusBox_index", String.valueOf( statusBox.getSelectedIndex())); 
			XMLEvent nameBox_inde = eventFactory.createAttribute( "nameBox_index", String.valueOf( nameBox.getSelectedIndex())); 
			XMLEvent currentTrackBox_index = eventFactory.createAttribute( "currentTrackBox_index", String.valueOf( currentTrackBox.getSelectedIndex())); 
			XMLEvent langMenu_index = eventFactory.createAttribute( "langMenu_index", String.valueOf( langMenu.getSelectedIndex()));
			XMLEvent windowActionBox_index = eventFactory.createAttribute( "windowActionBox_index",  "1"); 
			if(activeTrayIcon.isSelected()) {
				windowActionBox_index = eventFactory.createAttribute( "windowActionBox_index",  String.valueOf( windowActionBox.getSelectedIndex())); 
			}
			XMLEvent lookAndFeel_index = eventFactory.createAttribute( "LookAndFeelBox_className",  "null"); 
			if(useAnotherLnfBox.isSelected()) {
				lookAndFeel_index = eventFactory.createAttribute( "LookAndFeelBox_className",lookAndFeelInfos[LookAndFeelBox.getSelectedIndex()].getClassName());
			}
			XMLEvent logLevel_index = eventFactory.createAttribute( "logLevel_index",  String.valueOf(logLevelBox.getSelectedIndex())); 
			XMLEvent endRoot = eventFactory.createEndElement( "", "", "Settings" ); 
			XMLEvent endDocument = eventFactory.createEndDocument();
			
			//finally write into file
			writer.add( header ); 
			writer.add( startRootSettings );
			writer.add( activeIconCB_S ); 
			writer.add( lookAndFeelCB_S ); 
			writer.add( showTextCB_S ); 
			writer.add( useInternalAudioPlayerCB_S ); 
			writer.add( ripperPathTF_S ); 
			writer.add( shoutcastTF_S ); 
			writer.add( generellPathTF_S ); 
			writer.add( fileBrowserTF_S ); 
			writer.add( webBrowserTF_S ); 
			writer.add( statusBox_index ); 
			writer.add( nameBox_inde ); 
			writer.add( currentTrackBox_index ); 
			writer.add( langMenu_index ); 
			writer.add( windowActionBox_index ); 
			writer.add( lookAndFeel_index );
			writer.add( logLevel_index );
			writer.add( endRoot ); 
			writer.add( endDocument ); 
			writer.close();

		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (XMLStreamException e) {
			e.printStackTrace();
		} 
		
		String[] path = new String[5];
		path[0] = ripperPathField.getText();
		path[1] = shoutcastPlayer.getText();
		path[2] = generellPathField.getText();
		path[3] = webBrowserField.getText();
		path[4] = fileBrowserField.getText();
		
		String newlnfClassName = null;
		if(useAnotherLnfBox.isSelected()) {
			newlnfClassName = lookAndFeelInfos[LookAndFeelBox.getSelectedIndex()].getClassName();
		}
		
		int[] actions = new int[4];
		actions[0] = statusBox.getSelectedIndex();
		actions[1] = nameBox.getSelectedIndex();
		actions[2] = currentTrackBox.getSelectedIndex();
		actions[3] = windowActionBox.getSelectedIndex();
		
		mainGui.setNewRuntimePrefs(actions,showTextCheckBox.isSelected(),activeTrayIcon.isSelected(),
				newlnfClassName,useInternalAudioPlayerCB.isSelected());
		mainGui.getControlStream().setPaths(path);
		
		//update the log Level
		int level = logLevelBox.getSelectedIndex();
		
		switch(level) 
		{
			case 0:
				SRSOutput.getInstance().setLoglevel(SRSOutput.LOGLEVEL.Nothing);
				break;
			case 1:
				SRSOutput.getInstance().setLoglevel(SRSOutput.LOGLEVEL.Error);
				break;
			case 2:
				SRSOutput.getInstance().setLoglevel(SRSOutput.LOGLEVEL.Normal);
				break;
			case 3:
				SRSOutput.getInstance().setLoglevel(SRSOutput.LOGLEVEL.Debug);
				break;
			default:
				SRSOutput.getInstance().setLoglevel(SRSOutput.LOGLEVEL.Normal);	
		}
		
	}