why is the repaint() method not calling paintComponent right

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Chandresh Juthani

why is the repaint() method not calling paintComponent right

Post by Chandresh Juthani » Thu Feb 21, 2002 10:28 pm

David,

Thanks for all your help. I just need this final help. if you can..

Let me tell you what chages I have made to the code and I will attach my code as well. Maybe if you can suggest me what I have done wrong and tell me what changes I need to make.

I have two plots namely normalization and post normalization.

What I need to do is on click on the pre normalization, I have to draw a horizontal line and a vertical line both on the pre Normalization and post normalization. What I did is create a new set of ArraytList called linkListener in the Plot.java and a method called notifyLinkListeners in the same. I nneded to do that because in that I do something which will call notifyListeners.. If I try to add this listener to the listeners() arraylist, an infinite loop is formed ending up throwing StackOverflowError.

Then in the handleClick method in the XYPlot.java the anchor values and the cross hair values are set which calls the notifyListeners which make call to this.repaint() and finally to the paintComponent method in the XYPlot.java. However it does not do that... My problem is that .. Is there any way , we can do that.

Hence I have to make two click before the desired effect happens.


--Chandresh

Locked