Well, that's a cool link. It doesn't seem to be calculating x and y for a given z though, like you would need to draw a topography map of a mountain. Instead it's drawing a three dimensional graph showing z values for all x, y over some range. It draws some lines on the graph for fixed values of x and y, but not fixed values of z.
Let's say that you actually do need to calculate
f(x,y) = c though. You would need to solve for y in terms of x, and then plot that on a two-dimension graph. For example, you have the formula for a cone:
z=√ (x² +y²) , and you want to solve that for z = 4. You rearrange it as
y = √(16 -x²), which gives you a circle with radius 4. Again, that's math though, not Java programing.
You should have a firm grasp of the math before you even think about converting it to a program.