I have my output window as shown here
My complete code is:
http://codes-at-igit.weebly.com/uploads/1/2/2/7/12272842/travellingsalesmanproblem.java
The circles are different G.P.S locations. I want to show the location i.e. , the longitude and latitude when mouse hovers on a node. I tried set tool tip text but it doesn't give privilege to specify the locations at which the text should occur. I have coded it in swing Java . I am working in Netbeans 7.1.2. So how can I do this?
How do I set tool tip text at a particular position?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
Try over-riding getToolTipLocation(), for example:
from here: http://www.java2s.com/Code/Java/Swing-JFC/ToolTipLocationExample.htm
You can simply override
public String getToolTipText(MouseEvent event)
of the underlying JComponent. Then based on the location of the event you can return null or the tooltip related to the node.Here is a small snippet demonstrating this: