Ok, well I want to create an input to move a graphic object around. I know I have to import java.awt.event and implement KeyListener. Now with KeyListener I want it to recieve input as either the char 'D' or 'A.' Recieveing 'D' will make my graphic (which is a line) move to the right by adding to the Xvalues in a rate proportional to the time I press 'D' down, and the same goes for the 'A' key but instead it will takeaway to the Xvalues and therefore make my object go left.

I've already done some of these by creating a variable called p1XPosition to equal 200, and in the graphics object I want to move, draws a line from p1Xposition to (p1xPosition + (getSize().width / 10)). All I really need to do is to create the input to increase p1xPosition and to repaint the graphics object.