import java.awt.*;
import java.applet.*;
class tp extends Component {

String index;

void DrawIndex(String idx, Graphics g) {
g.setColor(Color.red);
g.drawString(idx, 10, 50);
}

public tp(String idx){
index = idx;
}

public tp() {
index = "10";
}
  
   public void paint(Graphics g) {
   super.paint(g);
   DrawIndex(index, g);
   }
  
   public void update(Graphics g) {
   paint(g);
   }
}
public class Temp extends Applet {

tp tp1 = new tp("ok");
public void init()
    {
     this.setLayout(new GridLayout(1,1));
     add(tp1);
    }
}
直接从awt继承下来的 tp 组件,要让它有 tooptips 的功能,应该怎样实现?哪位同志实现过这样的功能,请赐教!!