Hi,
My problem is that I need to tell class A to repaint, but from class B.
Class B will be a thread that updates components of class A and will eventually tell A to repaint.
The basic idea of my code is as follows:
class A extends JPanel{
Thread b;
...
b = new B();
paint(Graphics g){
...
}
}
class B extends A implements Runnable{
run(){
...
//Tell A to repaint
}
}
From my understanding of swing, I need to tell A to repaint when referring directly to it
For example:
class X{
A a;
...
a.repaint();
}
Or I could call repaint inside of Class A
class A{
...
repaint();
}
But how do I do this from the run()
method of class B?
Thanks in advance.