Article View: borland.public.jbuilder.java.swing
Article #8546Re: double click!?
From: David Jefferson
Date: Tue, 15 Aug 2000 00:00
Date: Tue, 15 Aug 2000 00:00
25 lines
1228 bytes
1228 bytes
Copied from the Java api docs for JList:
final JList list = new JList(dataModel);
MouseListener mouseListener = new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() == 2) {
int index = list.locationToIndex(e.getPoint());
System.out.println("Double clicked on Item " + index);
}
}
};
list.addMouseListener(mouseListener);
Hope this helps,
Dave
"Roland Zumkeller" <Roland.Zumkeller@web.de> wrote in message
news:3997A9C3.23056AAB@web.de...
> Hi,
> I'm using a JList and want to react if the user double-clicks on one
> item. How can this be done?
>
> Thanks,
>
> Roland
Technical Details
Message-ID:
<3999776a_1@dnews>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<3997A9C3.23056AAB@web.de>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,7544c554920b94b6 X-Google-Attributes: gid111d45,public From: "David Jefferson" <david.jefferson@kbcfp.com> Subject: Re: double click!? Date: 2000/08/15 Message-ID: <3999776a_1@dnews> X-Deja-AN: 658590077 References: <3997A9C3.23056AAB@web.de> X-Trace: 15 Aug 2000 10:01:30 -0800, 194.203.209.252 X-MSMail-Priority: Normal X-Priority: 3 Newsgroups: borland.public.jbuilder.java.swing X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700