Drawing on JFrame / JPanel in Netbeans
Hello All,
I'm writing a project in NetBeans 5.5, and I need to draw some graphics onto my form, or even more preferable my panels. I've drawn on stuff before in java using the .drawRect etc. method, and although this is fairly simply, I'm now using NetBeans and can't figure out how to do it! I realize that these forums are mostly for java-specific, as oposed to IDE-related questions, but I was wondering if anyone can tell me how to use these methods-or one similar to them in the NetBeans IDE (using a Jpanel or JFrame). Thanks so much! Any help is greatly appreciated.
-Robert
[605 byte] By [
rlindmana] at [2007-11-27 4:08:54]

> Hello All,
> I'm writing a project in NetBeans 5.5, and I
> need to draw some graphics onto my form, or even
> more preferable my panels. I've drawn on stuff
> before in java using the .drawRect etc. method, and
> although this is fairly simply, I'm now using
> NetBeans and can't figure out how to do it! I
> realize that these forums are mostly for
> java-specific, as oposed to IDE-related questions,
> but I was wondering if anyone can tell me how to use
> these methods-or one similar to them in the NetBeans
> IDE (using a Jpanel or JFrame). Thanks so much! Any
> help is greatly appreciated.
> Robert
You simply write your own JPanel with the paintComponent overriden, and then you add it to the Palette from Tools > Add to Palette... so you can then drag and drop it with matisse