Article View: borland.public.jbuilder.java.swing
Article #8565Re: JTable question
From: John P. McGrath
Date: Tue, 08 Aug 2000 00:00
Date: Tue, 08 Aug 2000 00:00
21 lines
1317 bytes
1317 bytes
On Mon, 7 Aug 2000 13:33:55 -0500, JNewbie wrote: > I have a JTable component that contains a bunch of URLs > in it. I would like to show the user that the content > the mouse is hovering over is a URL by underlining the > contnent below the mouse. Is there anyway to do this? > I thought you would have to use the OnMouseEnter event > to see if the mouse is over the JTable control...but I > don't know how to find out which cell the mouse is over > if it is not selected. I do not want to have to select > the cell if I don't have to. A cell in a JTable is not a Component, so you will not be able to use the MOUSE_ENTERED and MOUSE_EXITED events for handling this. But you can add a MouseMotionListener to the JTable, and use the JTable columnAtPoint() and rowAtPoint() methods to convert the position to cell coordinates. -- Regards, John McGrath
Technical Details
Message-ID:
<MPG.13f949aaf4fcecc4989a9a@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<398eff0e$1_2@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,8a545a90f4bfa63e X-Google-Attributes: gid111d45,public From: John P. McGrath <JPMcGrath@fast.net> Subject: Re: JTable question Date: 2000/08/08 Message-ID: <MPG.13f949aaf4fcecc4989a9a@forums.borland.com> X-Deja-AN: 655705090 References: <398eff0e$1_2@dnews> Organization: Another Netscape Collabra Server User Newsgroups: borland.public.jbuilder.java.swing