Mega Code Archive

 
Categories / Java Tutorial / Swing
 

Showing an Image in a Tool Tip

import javax.swing.JButton; public class Main {   public static void main(String[] argv) throws Exception {     JButton component = new JButton();     String imageName = "file:image.jpg";     component.setToolTipText("<html>Here is an image <img src=" + imageName + "></html>");   } }