Problems with repaint()

Hello,

My program receives notifications from a notification server and then represents these notifications in the form of a barchart every 5 seconds. I use AWT for the graphics. However, my repaint() method does not work. IThe method that receives the notifications, counts the number of notifications it receives every 5 seconds and then calls the repaint() method to update the barchart.

I would really appreciate any replies,

Thank you,

Santhoshi

[488 byte] By [sdb23] at [2007-9-26 13:37:09]
# 1
do you make allowance for the notification in the paint(), i mean does the chart depend on the No. of notific..
swingfreak at 2007-7-2 14:16:25 > top of Java-index,Desktop,Core GUI APIs...
# 2
Try moving the code from repaint() into paint(), and remove your repaint() method.Regards,Manuel Amago.
mamago at 2007-7-2 14:16:25 > top of Java-index,Desktop,Core GUI APIs...
# 3
As Manuel stated, move your code from repaint() to paint(). You shouldn't be implementing the repaint() method, but it is fine to call it. When you receive notifications you should just make a call to repaint(), that will queue a call to the paint() method.
msguillory at 2007-7-2 14:16:25 > top of Java-index,Desktop,Core GUI APIs...
# 4
Thanks a lot for your reply!But, I tried that already, but it still doesn't work. The problem is that, though it call the paint() method everytime there's a call to reapint(), the new values of the coordinates are not registered. So, it doesn't update my barchart.
sdb23 at 2007-7-2 14:16:25 > top of Java-index,Desktop,Core GUI APIs...
# 5
That is probably the problem then. How are you making the changes to the coordinates? The coordinates should be instance variables. On receiving the notification events, you should increase/change the coordinate variables, which should be updated by the time repaint() is called.
mamago at 2007-7-2 14:16:25 > top of Java-index,Desktop,Core GUI APIs...