Java, JFrame, 3D Perspective in 2D Space : I'm working in Java with its JFrame. I want to be able to draw 3D objects like a cube. 

But I have a problem, I don't know how to calculate the x and y position of where the vertices would go on the z axis.

I'm not working in OpenGL or anything, just using java's built in features.

I have the window set up and i'm able to draw lines, all I kneed to know to be able to get this to work is the calculation of where the position of vertices on the z axis would be placed in a 2D space.

Thank you in advance for any help!