@Override
	public void actionPerformed(ActionEvent e) {
		if (_textField.getText().trim().isEmpty()) {
			JOptionPane.showMessageDialog(cs.mainview,
			    "Please enter an initial query first.",
			    "Query is empty",
			    JOptionPane.ERROR_MESSAGE);
		} else {
			if(Integer.parseInt(_textField.getText()) < 1 || Integer.parseInt(_textField.getText())>cs.p.maxCycles) {
				JOptionPane.showMessageDialog(cs.mainview,
					    "Please enter a number between 1 - " +cs.p.maxCycles,
					    "Wrong cycle number",
					    JOptionPane.ERROR_MESSAGE);
			}
			else {
				cs.population.setBarCycles(Integer.parseInt(_textField.getText()));
				cs.p.cycleforbar=Integer.parseInt(_textField.getText());
				//create new barchart
				BarCharts bc = new BarCharts(cs.population);
				JInternalFrame frame2 = new JInternalFrame("Bar Chart Result, cycle: "+Integer.parseInt(_textField.getText()), true, true);
				frame2.setContentPane(bc.getPanel());
				frame2.setSize(cs.jdp.getWidth()/2-5, cs.jdp.getHeight()-50);;
				//RefineryUtilities.centerFrameOnScreen(frame2);
				frame2.setLocation(cs.jdp.getWidth()/2, 50);
				frame2.setVisible(true);
				frame2.addMouseMotionListener(new FrameMouseMotionListener(frame2, cp));
			
				cs.jdp.add(frame2);
				
				frame2.toFront();
				_textField.requestFocus();
				_textField.selectAll();
			}
		}
	}