Drawing to Canvas

HiHow I can, paint lines to canvas?I have application and GUI in Swing and I need to plott graph, but I don't know how I can do it :(I think that I need canvas and dwar lines to it, but I'm not sure :(please past here same sample code Please help me :)
[296 byte] By [lama_powera] at [2007-10-3 10:51:10]
# 1
[url http://java.sun.com/docs/books/tutorial/uiswing/painting/index.html]Custom Painting[/url]
camickra at 2007-7-15 6:16:22 > top of Java-index,Desktop,Core GUI APIs...
# 2
I read this tutorial, but I don't understand :(it is about custom painting of components, but I need paint for example lines or grahps
lama_powera at 2007-7-15 6:16:22 > top of Java-index,Desktop,Core GUI APIs...
# 3
Well there area methods like drawLine(...), drawPolyLine(...) which can be used. I think the is a graphing package, JGraph. Search the forum for other ideas.
camickra at 2007-7-15 6:16:22 > top of Java-index,Desktop,Core GUI APIs...
# 4
I know, but where in my code i should use this functions?for example: I init my components of GUI (buttons, textflieds...) in constructor, but i don't know where i must call drawline :(
lama_powera at 2007-7-15 6:16:22 > top of Java-index,Desktop,Core GUI APIs...
# 5
> but i don't know where i must call drawline Thats what the tutorial is for.Here is a simple example to get you started: http://forum.java.sun.com/thread.jspa?forumID=57&threadID=594537
camickra at 2007-7-15 6:16:22 > top of Java-index,Desktop,Core GUI APIs...