Set the Location of a Tool Tip in Java
Description
The following code shows how to set the Location of a Tool Tip.
Example
import java.awt.Point;
import java.awt.event.MouseEvent;
// w ww .j a v a 2s . c om
import javax.swing.JButton;
public class Main {
public static void main(String[] argv) throws Exception {
JButton button = new JButton("My Button") {
public Point getToolTipLocation(MouseEvent event) {
return new Point(0, 0);
}
};
}
}
Home »
Java Tutorial »
Swing »
Java Tutorial »
Swing »