i am very bigginer to java .i trying to draw a line in a jpanel (using netbean ide)..i read some articles .but problem is it draw thais line without calling it .i want to draw l
please add proper methods to be invoked from button listener. Also add panel where you want to draw line. This seems to be a probable duplicate of :-
Drawing a line on a JFrame