Use the default tool tip location in Java
Description
The following code shows how to use the default tool tip location.
Example
//w w w. j av a 2 s . co m
import java.awt.Point;
import java.awt.event.MouseEvent;
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 null;
}
};
// Set the tool tip text
button.setToolTipText("aString");
}
}
Home »
Java Tutorial »
Swing »
Java Tutorial »
Swing »