I want to display an info box on mousing over a JTable cell using Java Swing, so there are multi-parts
- How can I capture the mouse-over event in a table cell? I have to be able to set the cell content, then get data on it.
- How can I display a panel/box with dynamic server data on mousing over that cell?
- How can I cache the info panel/box so I don't have to query the server on every mouse over?
Example:
In table cell I enter: 94903. After tabbing or entering, the cell is set to the number. On mouse-over, it displays a box with Name, Address, Phone number, email, etc.
Thanks!
Heres a good way to get the mouse over working I woud do this first then just output some text when your over it to check.
This shows a way to get a pop up menu to appear
And in regards to the cacheing i might store the last 10 values in memory and do a request from the server each time a new entry point is pinged ie you dont have it locally. And then maybe every minute update the last 10 hit incase their info changes.
another useful mouseover guide
You could format the tooltip text using HTML, this would allow you to provide a complex structure of information to the tooltip without the need or expense of writing your own solution. The only problem is that the tooltip will be automatically discarded.
If this still doesn't suit, you could try:
Now, I've not constructed the popup, I'd use the popup menu from Bob Sinclar's answer as well