public void actionPerformed(ActionEvent ae) {
						try {
							String tmpfilename = "tmp.bif.file.xml";
							BayesNetGenerator generator = new BayesNetGenerator();
							String[] options = new String[4];
							options[0] = "-M";
							options[1] = "" + jTfNrOfInstances.getText();
							options[2] = "-F";
							options[3] = tmpfilename;
							FileWriter outfile = new FileWriter(tmpfilename);
							StringBuffer text = new StringBuffer();
							if (m_marginCalculator == null) {
								m_marginCalculator = new MarginCalculator();
								m_marginCalculator.calcMargins(m_BayesNet);
							}
							text.append(m_marginCalculator.toXMLBIF03());
							outfile.write(text.toString());
							outfile.close();

							generator.setOptions(options);
							generator.generateRandomNetwork();
							generator.generateInstances();
							m_Instances = generator.m_Instances;
							a_learn.setEnabled(true);
							a_learnCPT.setEnabled(true);

							m_sFile = jTfFile.getText();
							if (m_sFile != null && !m_sFile.equals("")) {
								AbstractFileSaver saver = ConverterUtils.getSaverForFile(m_sFile);
								// no idea what the format is, so let's save it as ARFF file
								if (saver == null)
									saver = new ArffSaver();
								saver.setFile(new File(m_sFile));
								saver.setInstances(m_Instances);
								saver.writeBatch();
							}

						} catch (Exception e) {
							e.printStackTrace();
						}
						dlg.setVisible(false);
					}