import javax.swing.*;
public class Test extends JFrame
{
JButton b1;
public Test()
{
super("test tip");
b1=new JButton("click here");
b1.setToolTipText("yes or no");//***关键**//
getContentPane().add(b1);
setSize(300,300);
setVisible(true);
}
public static void main(String args[])
{
new Test();
}
}