private String getStackTrace() {
		try {
			// force an exception so you can inspect the stack trace
			throw new ErrorReport("Error trace:");
		} catch (ErrorReport e) { // catch the exception
			// record the original stack trace
			StackTraceElement[] ste = e.getStackTrace();

			// copy only the relevant entries
			int length = Array.getLength(ste);
			StackTraceElement[] tmpSTE = new StackTraceElement[length];
			int ui = 0; // index for the stripped stack trace
			for (int i = 3; i < length; i++) {
				String cname = ste[i].getClassName();
				if (!((cname.startsWith("tester."))
						|| (cname.startsWith("sun.reflect"))
						|| (cname.startsWith("java.lang"))
						|| (cname.startsWith("bluej")) || (cname
								.startsWith("__SHELL")))) {
					tmpSTE[ui] = ste[i];
					ui = ui + 1;
				}
			}

			// we cannot have null entries at the end
			StackTraceElement[] userSTE = new StackTraceElement[ui];
			for (int i = 0; i < ui; i++) {
				userSTE[i] = tmpSTE[i];
			}

			// now set the stack trace so it can be converted to a String
			e.setStackTrace(userSTE);

			StringWriter writer = new StringWriter();
			PrintWriter printwriter = new PrintWriter(writer);
			e.printStackTrace(printwriter);

			return writer.toString();
		}
	}