popup window when mouse over a row in a JTable

Hello

can I have popup window when mouse over a row in a JTable (if users move the mouse over a row for some seconds). This popup will show some content of the row (as a tool tip for button).

Thanks for any help

shuhu

[242 byte] By [shoaa] at [2007-11-27 10:47:52]
# 1

here's a thread about mouseover in jtable with popup.

http://forum.java.sun.com/thread.jspa?threadID=744266&messageID=4265025

Yannixa at 2007-7-28 22:22:36 > top of Java-index,Desktop,Core GUI APIs...
# 2

Sure you can. It's a JToolTip. Check the API to know how to use it.

There's also a Popup class (I don't know much about it) that lets you do more complicated things, I think.

java_knighta at 2007-7-28 22:22:36 > top of Java-index,Desktop,Core GUI APIs...
# 3

Read the JTable API and follow the link to the Swing tutorial on "How to Use Tables" which explains how to use a tool tip on a table.

camickra at 2007-7-28 22:22:36 > top of Java-index,Desktop,Core GUI APIs...
# 4

> here's a thread about mouseover in jtable with popup.

> http://forum.java.sun.com/thread.jspa?threadID=744266&messageID=4265025

They say the past comes back to haunt you, but I never knew it would be this scarry. That was really some silly code I posted in the reply to OP's question in that thread. I thank God I'm now a slightly better coder than I was in 2006.

The MouseListener should be added to the CellRenderer, it should be added to the JTable, JList or whatever component you need to listener for events.

Here is another post showing the above comment: http://forum.java.sun.com/thread.jspa?threadID=5194403

ICE

icewalker2ga at 2007-7-28 22:22:36 > top of Java-index,Desktop,Core GUI APIs...
# 5

I think you meant to say:

The MouseListener should not be added to the CellRenderer, it should be added to the JTable, JList or whatever...

camickra at 2007-7-28 22:22:36 > top of Java-index,Desktop,Core GUI APIs...
# 6

> I think you meant to say:

> The MouseListener should not be added to the CellRenderer, it should be added to the JTable, JList or whatever...

EXACTLY. Thanks for the typo correction.

ICE

icewalker2ga at 2007-7-28 22:22:36 > top of Java-index,Desktop,Core GUI APIs...