Units conversion

I've been banging my head against the wall for a while now attempting to figure out how to draw my objects. The problem is that I don't understand how to convert from objects in meters to data that I can actually paint with. The tutorials all seem to gloss over the math. Like why do you need to factor in the screen width?

Can someone please explain the math?

If anyone has some sample code painting a simulation with JFrame that would be awesome.

Thanks.
the math depends on the scale used by your drawing system.

box2d is build yo work in meters, with object in the range from 0.1 to 10 meters. So your body should be at least near this range.
But maybe your graphic system use pixel, so the biggest object of 10 pixel is really small, and smallest object is not drawable. Let's say you like to have biggest object of 1000px and smallest of 10px, you have to multiply physic size by 100.
Or maybe your graphic system use meter, then you do nothing
Or maybe use it's own system, then you have to check theyr suggested range, and find a good multiplicator

if you use pixel units, this engine will probably suck, and you'll get all sorts of jitter and stuff. Please, please, PLEASE, factor in a scaling factor, or (better) a camera class that transforms your physics data before you draw it. Your physics objects should always be roughly between .1 and 10 world-units, which using pixel scale is far too small. Things will NOT work well at the 100-500 unit range, as the engine is not tuned for such large numbers.

Original thread: https://box2d.org/forum/viewtopic.php?t=9375