You will have to build a dynamic query statement. My advice would be to start with a basic query string: "select * from customers ". Then, if the name and/or City textfields have data in them, add SQL text to your query string. For example, in the second screen above, the final query string would be:
select * from customers where city like 'Tampa%' order by zip
If the user entered 'Forth' for the name, and 'T' for the city, then the query would look like:
select * from customers where name like 'Forth%' and city like 'T%' order by name
Note that I'm using 'like' in the where clause. This means that the query will look for names starting with 'Forth', and cities starting with 'T' -- Tampa in our db.
Also remember to include the logical AND if both name and city textfields are selected. Otherwise, the where clause does not include any logical operator.
Once you have your query string built, you can then execute it. (a executeQuery statement is fine). Loop through the result set and build a nice formatted string for each result, which you will then append to the text area using the appendText() method.