I haven't tried drawing a line like that for some time, but as far as I can remember, you don't even try it on a JFrame. You add a JPanel to the JFrame, and put such drawing into the paintComponent(Graphics g) method. Two warnings
You have to put super.paintComponent(); as the first line of your method.
There is also a paintComponents() method, so don't get confused with it.
Then you get a Graphics object in the method, which makes it easy to write g.drawLine(x1, y1, x2, y2); [ September 19, 2006: Message edited by: Campbell Ritchie ]
Joined: Mar 23, 2005
thanks for your reply!
i currently have what you suggested in my code - but ommitted them from the code listing for simplicity. is there a method in the Graphics class to paint individual pixels, or will i need to paint lines with length 1?