private void changeRanges() {
		boolean flag = false;
		try {
			int x = Integer.parseInt(a.getText());
			if (x <= 0)
				throw new IllegalArgumentException();
			
			flag = true;
			int y = Integer.parseInt(b.getText());
			if (y <= 0)
				throw new IllegalArgumentException();
			
			if (x != drawingPanel.getXRange()){
				ArrayList<Point2D[]> points = new ArrayList<Point2D[]>();
				for (int i = 0; i < graphs.size(); i++){
					points.add(graphs.get(i).getPoints(-x, x, 1200));
				}
				drawingPanel.setGraphs(points);
				drawingPanel.setXRange(x);
			}
			if (y != drawingPanel.getYRange()){
				drawingPanel.setYRange(y);
			}
		} catch (Exception ex){
			new MessageDialog(this, "Invalid range\nPlease check your input!", MessageDialog.ERROR).setVisible(true);
			a.setText(drawingPanel.getXRange() + "");
			b.setText(drawingPanel.getYRange() + "");
			if (flag){
				b.requestFocus();
			} else {
				a.requestFocus();
			}
		}
	}