drawing to a paint component?
basically i have called in an instance of the paintComponent on my form... as follows...
Code:
MyPanel tester = new MyPanel();
tester.setSize(800,600);
the MyPanel object is just a painComponent, but i need to draw into it... from within my current class, without hard coding it into the MyPanel class, can anyone help?
Re: drawing to a paint component?
Quote:
Originally Posted by
Slippy
basically i have called in an instance of the paintComponent on my form... as follows...
'paintComponent' is a method, not a class, so you can't have an instance of it, but you can call it...
Quote:
the MyPanel object is just a painComponent, but i need to draw into it... from within my current class, without hard coding it into the MyPanel class, can anyone help?
It's not clear what MyPanel is, but it's probably a subclass of JPanel - it isn't a paintComponent, there is no paintComponent class.
If you can explain in plain English what you are trying to achieve, perhaps we can help.
Precise language is not the problem. Clear language is the problem...
R. Feynman