JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

So when the button is pressed, have the code above execute, and have the above code call tryMaze? Then where do I put the timer and stuff?

Yes, just that, you don't need the timers etc, this should be sufficient (assuming I typed it ok!). Now, when your method does its sleep(...) the Java Swing thread will be able to run and process window updates.

Oops- I did miss-type, missed the line with the Thread! This should be better

new Thread(
  new Runnable() {
	public void run() {
		// call your tryMaze here
	}
  }
).start();
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

I guess that tryMaze is the entry point where the real work starts, and that you call it in response to the button being clicked. Just change that call to run in another thread, using an anonymous inner class something like this:

new Runnable() {
	public void run() {
		// call your tryMaze here
	}
}.start();

(didn't have time to check that exactly, done from memory)

JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

What thread does your findNext run on? Is it on the Swing thread (started in reponse to a user input)?
Real-time UI updates like this typically fail because the "worker" code is running on the Swing thread and thus blocks Swings normal UI activity until it finishes. Sleeping doesn't help in this case because its the Swing thread that is slept. You need to run findNext in a "worker" thread so the Swing thread can update the UI when you sleep the worker.
If all this is new to you, read http://java.sun.com/docs/books/tutorial/uiswing/concurrency/index.html

verruckt24 commented: Good one. +2
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

The error is right here as i pointed out before, in the main method
""output = (aParser.doParse(output)); // do the evaluation""
output = (aParser.doParse(output)); // do the evaluation
that line

Type mismatch: cannot convert from int to String

Well. you didn't give us the exact line before (unless I missed it).
Problem is that doParse returns an int and you're trying to assign it to a String variable. Either change the return type to String, or change "output" to int, or convert like Ezzaral says.

notuserfriendly commented: thanks +3
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

You need to post the exact error message and the line it refers to. Also format your code listing with line numbers so we can see exactly where the error is.

JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

Think about separating the logic and the UI fully. Java's an OO language, so use objects.
Define a Tax object, with the taxable amount, tax bands etc as its instance variables, and the tax calculation as a public method. Include public "set" methods for the taxable amount and filing status - these should do the validation and either throw an exception or return an error message String if the input is bad.
The UI then creates a new Tax object, displays prompts, gets the input, and calls the "set" methods, displaying any errors that get returned. Finally the UI can call the tax calc method and display its result.