import java.awt.;
import javax.swing.;
public class bookb extends JPanel {
static JFrame myFrame;
public bookb(){
JButton submit = new JButton("提交");
submit.setMnemonic('s');
submit.setToolTipText("数据提交");
JButton back =new JButton("返回");
back.setMnemonic('b');
back.setToolTipText("返回到主菜单");
add(submit);
add(back);
}
public static void main(String[] args) {
JFrame myiframe =new JFrame("带提示信息的按钮");
myFrame =new JFrame("有工具提示的按钮");
bookb tb= new bookb();
myFrame.getContentPane().add("Center",tb);
myFrame.setSize(400,200);
myFrame.setBackground(Color.orange);
myFrame.setVisible(true);
}
}