ToolTipDemo.java Source code

Java tutorial

Introduction

Here is the source code for ToolTipDemo.java

Source

import javax.swing.JButton;
import javax.swing.JFrame;

public class ToolTipDemo {
    public static void main(String args[]) {
        JFrame frame = new JFrame();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        JButton b = new JButton("Hello, World");
        frame.add(b, "Center");
        b.setToolTipText("asdf");
        frame.setSize(300, 200);
        frame.setVisible(true);
    }
}