I am doing a project where I have planes scattered on a grid. I need to have a tooltiptext that when the cursor is over the plane icon it will display the ID number, X, Y, and Z coordinates that are being read from a .txt file.
My guess is that I will need a mouse motion listener added and then in the parenthesis of the tooltiptext I’ll be calling getID, getX, getY, and getZ.
C# right. There is a MouseEnter and MouseLeave event for all the objects. Use those events and the code below.
To make it show up:
private ToolTip toolTip = new ToolTip();
string s = "ID: " + id.ToString() + "ect...";
toolTip.Show(s, this, 2000);
To make it fade out:
toolTip.Hide();
s << string that will be displayed
this << is the form
2000 << Duration (2seconds).
… Do you need the code to read from a text file… just google there are thousand tutorials that can explain it perfectly. If you need to get the values out of the text file show us how you have the text file set up.
Uh…sorry probably should’ve specified, its JAVA.