|
-
March 10th, 2009, 03:28 PM
#1
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?
-
March 10th, 2009, 06:54 PM
#2
Re: drawing to a paint component?
 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...
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
Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|