public void actionPerformed(ActionEvent ae) {
		double x = 0.0, y = 0.0;
		Double d;

		try {
			d = new Double(eastings.getText());
			x = d.doubleValue();
		} catch (NumberFormatException nfe) {
			eastings.setText("0");
			x = 0.0;
		}

		try {
			d = new Double(northings.getText());
			y = d.doubleValue();
		} catch (NumberFormatException nfe) {
			northings.setText("0");
			y = 0.0;
		}

		DPoint p0 = new DPoint(x, y);

		String pfxs = prefix.getSelectedItem();

		DPoint dp = osni.GridSquareToOffset(pfxs.charAt(0));
		dp.offsetBy(p0);

		DPoint p = osni.GridToLongitudeAndLatitude(dp);

		DPoint osgbPoint = osgb.LatitudeAndLongitudeToGrid(p);

		String str;

		if (osgbPoint.getX() >= 0.0 && osgbPoint.getY() >= 0.0) {
			str = new String(osgb.GridToGridSquare(osgbPoint));
			osgbPrefix.setForeground(Color.blue);
			osgbPrefix.setText(str);
		} else {
			osgbPrefix.setForeground(Color.red);
			osgbPrefix.setText("NO GRID SQUARE");
		}

		double osgbX = osgbPoint.getX() % 100000.0;
		if (osgbX < 0.0)
			osgbX += 100000.0;

		str = myFormat.format(osgbX);

		osgbEastings.setText(str);

		double osgbY = osgbPoint.getY() % 100000.0;
		if (osgbY < 0.0)
			osgbY += 100000.0;

		str = myFormat.format(osgbY);

		osgbNorthings.setText(str);

		str = pfxs + " " + myFormat.format(p0.getX()) + " "
				+ myFormat.format(p0.getY());
		gridinput.setText(str);
	}