i have a question on how to extends classes. i have three classes main, aaa, bbb classes.
i want to draw something in bbb class and print in main. for ex
main <-> aaa <-> bbb
but nothing is being print at output. if i draw something in main, or aaa than it works fine. any ideas's.
public class main extends JApplet
{
aaa aaa_class = new aaa();
...
public void paint(Graphics g)
{
super.paint(g); //redraw
aaa_class.paint(g);
}
}
aaa class--------------------
public class aaa
{
public levels()
{
}
public void paint(Graphics g)
{
}
}
bbb classs-------------
public class bbb extends aaa
{
int x,y,width,height..etc
public bbb()
{
}
@Override
public void paint(Graphics g)
{
g.fillRect(x,y,width,height);
super.paint(g);
}
}