Results 1 to 8 of 8
Thread: PaintComponant help
- 11-18-2010, 05:15 PM #1
Senior Member
- Join Date
- Sep 2010
- Posts
- 109
- Rep Power
- 0
PaintComponant help
Hello, unlike most of my questions i will not have source code for this unfortunately. i add elements to an array, then, i use the x,y from the points on the array to graph points on my screen through paint component. the problem i am having is i cannot paint multiple ovals on the screen. i use drawOval(px,py,3,3); px, and py, are the x's,and y's of the points in my array. problem is it paints one point, then when i add another point, it reprints the old point instead of adding a new one, and i dont know how to fix this haha.
- 11-18-2010, 05:18 PM #2
We can't help without an SSCCE. It really shouldn't be hard to throw one together for this question.
- 11-18-2010, 05:33 PM #3
Senior Member
- Join Date
- Sep 2010
- Posts
- 109
- Rep Power
- 0
Well you obviously dont understand my point. i do not have a neat source for this. I could, but the sense of this should be somewhat easy to develop your own sense of the problem.
- 11-18-2010, 05:44 PM #4
Sure. This is a 20 line program. But the hard part is imagining where your problem is inside that program. We can't guess at that until we see some code.
- 11-18-2010, 05:57 PM #5
Senior Member
- Join Date
- Oct 2010
- Location
- Germany
- Posts
- 780
- Rep Power
- 4
do you have the problem after a second paintComponent/repaint call? or are you drawing the two ovals one after another in the paintComponent?
in first case: you could draw on a bufferedimage and in your paintComponent you have to draw only that image. or you store the (oval) objects in a list, iterate over the list ..or... or .... --> read also Painting in AWT and Swing
in second case: as has been said - show us code :)
-
I agree, that we'll be much better able to help if we have code to base the problem and help on. I'm still not sure what's preventing you from creating and posting an SSCCE.
- 11-19-2010, 01:16 AM #7
Senior Member
- Join Date
- Sep 2010
- Posts
- 109
- Rep Power
- 0
The main reason is, its not a writen code problem, unlike most questions, its not actually a problem in any code i have, whereas normally i have a program i am working on and i run into a problem and the code is written, but this however is not a problem that is inflicting me, more so then just a problem i know off.
- 11-19-2010, 01:17 AM #8
Senior Member
- Join Date
- Sep 2010
- Posts
- 109
- Rep Power
- 0


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks