Java Netbeans override paint() function in a JPanel
Hi I'm a newbie programmer
I want to develop a Java program's GUI using Netbeans IDE
Using Netbeans UI Editor,
First, I create a new JFrame Form
Then, I add a JPanel from the toolbar/palette
Question is,
How can I override the paint() function of the newly created JPanel ?
I want to draw a background and some spheres inside the JPanel,
I tried using getGraphics() function to paint and draw, it does the job,
but it won't draw anymore when I call repaint()
Should I create a new class implementing JPanel, with my custom paint()
function, instead ?
No comments:
Post a Comment