用下面的方法可以在工具提示中加入网站上的图片:button.setToolTipText("<html>hello<br>world<img src='http://www.matrix.org.cn/i/logo.gif'> </html>"); 如何在工具提示栏中添加本地的一张图片 JButton btn = new JButton("ssss");String userdir = System.getProperty("user.dir");String filename = "file:///" + userdir + "/marry.jpg";btn.setToolTipText("<html>hello<br>world<img src='" + filename + "'></html>");或者JButton btn = new JButton("ssss");URL url = new File("marry.jpg").toURL();btn.setToolTipText("<html>hello<br>world<img src='" + url + "'></html>");