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 = (String)prefix.getSelectedValue();

		DPoint dp = osgb.GridSquareToOffset(pfxs.charAt(0), pfxs.charAt(1));
		dp.offsetBy(p0);

		DPoint p = osgb.GridToLongitudeAndLatitude(dp);

		double phi, lambda;

		lambda = (180.0 / Math.PI) * p.getX();
		phi = (180.0 / Math.PI) * p.getY();

		double ls = Math.abs(lambda);
		double ps = Math.abs(phi);

		int ld, lm, pd, pm;

		ld = (int) ls;
		ls = 60.0 * (ls - ld);
		lm = (int) ls;
		ls = 60.0 * (ls - lm);

		pd = (int) ps;
		ps = 60.0 * (ps - pd);
		pm = (int) ps;
		ps = 60.0 * (ps - pm);

		String str = ld + "\u00b0 " + lm + "\' " + myFormat.format(ls) + "\""
				+ ((lambda < 0.0) ? " West" : " East");

		latitude.setText(str);

		str = pd + "\u00b0 " + pm + "\' " + myFormat.format(ps) + "\""
				+ ((phi < 0.0) ? " South" : " North");

		longitude.setText(str);

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