I'm sorry, you do not even have to use that command as the constructor take a value for the maximum.
The last parameter in the bar constructor call IS the maximum value.
Create your bars as follows:
Of course x, y, x2, and y2 values will have to be supplied.
Bar pBar = new Bar("Projectile", "", 200, 400); Bar cBar = new Bar("Counterweight", "", 2000, 4000); addObject(pBar, x, y); addObject(cBar, x2, y2);