I'm having real trouble getting a simple paint program to work. My goal is to draw in a JPanel and save the drawing to hdd; It's only a small panel in a larger JFrame, not a drawing program, so there are only a few simple colour buttons and a clear function.
My problem is that I cannot figure out for the life of me how to override the paintComponent method; I've read the sun tutorials here:
tutorial gone through literally dozens of threads like this one:
paint problem and come back blank, because everytime I try to implement the code in my project there is no paintComponent method to override;
Here:
Using netbeans, I should get an "add override" message pointing to the paintComponent method shouldn't I? This is in a JFrame and I also override paint, which I've commented out for the moment as I wondered if that affected it.
General program structure:
Main class instantiates JFrame. JFrame has controls and stuff on it, including a JPanel (not paintPanel at the moment)
On the JFrame, you can draw in the JPanel as I've set it up, but I know my code is shaky and I want to sort it our by overriding the correct way; There's nothing there to override though - what am I missing???