could you be more specific? Are you drawing your lines using Graphics.drawLine, or Graphics2D.draw(Line2D)?
if you are using Graphics.drawLine, you will need to rotate your graphics object in the opposite direction, otherwise, you can create an Area from your Line2D, and rotate it, and draw the rotated Area.
Furthermore, how much do you want to rotate it by? Are you rotating by exact multiples of 90 degrees, or by some other angles? I also don't understand what you mean by rotating in the x or y axis. Rotation in 2D occurs about a point, not about a line. Rotation about a line occurs in 3D space.
Will you be rotating about the origin, or about some other point?
I don't mind answer this question here, but I'm not sure why you moved it here. I would think it should be moved to the Other Java API's forum, which indicates that it is the correct location of Java2D related threads.