Re: How to draw a simple line....




"TheBigPJ" <TheBigPJ@xxxxxxxxx> wrote in message
news:1180283348.916553.87450@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Good Morning/Evening

Could someone please show me how to draw just a simple line from say
1,1 to 25,25 using the 2d package?


package test;

import java.awt.Graphics;
import javax.swing.JFrame;

public class LineTest extends JFrame {

public LineTest() {
setBounds(0,0,100,100);
setVisible(true);
}

protected void paintComponent(Graphics g) {
g.drawLine(0,0,25,25);
}

public static void main(String... args) {
new LineTest();
}
}

--
Mike W


.