Q:

Way to get around integer requirements of g2.drawLine() method

I am currently trying to draw a line and keep the line proportionally the same no matter how the user resizes the JFrame. However, the problem I run into is when I try to draw a line when the user makes the JFrame smaller than the default value, as I end up multiplying the coordinates by fractions under 1, and since g2.drawLine() requires integers, it takes them as 0's and nothing is drawn. I'm wondering if there's a work-around to this little glitch or if you guys have any suggestions of how I should change my logic. 

A:

I think what you're seeing is just because of integer division. See Why is the result of 1/3 == 0?. When you have (width / 624), the result of this is always 0 if width is less than 624.
You could:

use (width / 624.0), which performs the division in floating-point (as double), or
you could rearrange your parentheses to be e.g. (int) ((x * width) / 624)) instead of (int) (x * (width / 624)).

However, to answer the question directly, you can draw a line with floating-point coordinates by using java.awt.geom.Line2D:
Line2D line2D = new Line2D.Double(x1, y1, x2, y2);
graphics2D.draw(line2D);

(Also see https://docs.oracle.com/javase/tutorial/2d/geometry/primitives.html.)

