Canvas Drawing in NetBeans

I'm very new to Drawing and NetBeans. I've made a simple window with a few fields and a button that do some random things (was making sure I knew how to manipulate GUI fields).

I built the window using Swing components. I put an AWT canvas in the dialog (can you mix Swing with AWT?), but now I don't know how to draw on the canvas (ex. how would I do a simple line?)

[383 byte] By [maxfarrara] at [2007-11-26 15:34:49]
# 1
you could just make a paint method in your Canvas and use Graphics to draw stuff
crazyuproara at 2007-7-8 21:52:14 > top of Java-index,Java Essentials,New To Java...
# 2
Rather than mixing Swing and AWT components, subclass JComponent (or JPanel) instead of subclassing Canvas -- there's nothing magical about the Canvas class.
DrLaszloJamfa at 2007-7-8 21:52:14 > top of Java-index,Java Essentials,New To Java...