tashe
January 27th, 2009, 09:17 PM
Hi
I am trying to make a visual representation of how frames are sent from a sender to a receiver in a network, with the Selective-Reject technique, using Java.
I have classes Sender and Receiver which should exchange frames and ACKs, and also draw lines on a JPanel, similar to the picture attached. These lines have to be drawn not at once, but every one after a short interval, lets say 0.5 sec. I thought about using the repaint() method, but I think it will erase the previous lines.
In previous programs, I did the drawing with the paint(Graphics g), but now I can't access "g".
Since the deadline is tomorrow I have no time for experimenting, so I decided to post here.
Does anybody know how can I draw the lines from outside the JPanel class?
Thank you
I am trying to make a visual representation of how frames are sent from a sender to a receiver in a network, with the Selective-Reject technique, using Java.
I have classes Sender and Receiver which should exchange frames and ACKs, and also draw lines on a JPanel, similar to the picture attached. These lines have to be drawn not at once, but every one after a short interval, lets say 0.5 sec. I thought about using the repaint() method, but I think it will erase the previous lines.
In previous programs, I did the drawing with the paint(Graphics g), but now I can't access "g".
Since the deadline is tomorrow I have no time for experimenting, so I decided to post here.
Does anybody know how can I draw the lines from outside the JPanel class?
Thank you