Path: csiph.com!feeder.erje.net!2.eu.feeder.erje.net!news.swapon.de!eternal-september.org!feeder.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Knute Johnson Newsgroups: comp.lang.java.programmer Subject: Re: What's the difference between mouseClicked and mousePressed? Date: Tue, 23 Jan 2018 14:06:39 -0600 Organization: A noiseless patient Spider Lines: 20 Message-ID: References: <65e683ec-444d-4a80-b3b4-e6de98bacc5e@googlegroups.com> <46ceca25-eec6-41b4-b304-f5424800b9eb@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 23 Jan 2018 20:06:42 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="a21b48d5ce45cba88405a537a5ef82b2"; logging-data="24490"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19gqWmqw3IkOICJn/2FevWz" User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 In-Reply-To: Content-Language: en-US Cancel-Lock: sha1:Q1VAFvs1HzUgke35wVY8GxGSz28= Xref: csiph.com comp.lang.java.programmer:37987 On 1/23/2018 13:03, Eric Douglas wrote: > On Tuesday, January 23, 2018 at 1:42:21 PM UTC-5, Daniele Futtorovic wrote: >> >> Also, MouseEvent has a #getClickCount(). Might be what you're looking for. >> >> -- >> DF. > > You can do if (e.getClickCount()==2) in mousePressed, or mouseReleased, seems to accomplish the same double click event as if you used mouseClicked, except I don't see a way to get to mouseClicked with touch events. > Are you using a different API? Otherwise touch events are the same as mouse events. It could be however that your Surface Pro is too slow in propagating events and you never see click counts greater than 1. On my Acer touch screen and that JavaWS program from the Tutorial that Eric posted I can get click counts of 2 but I have to be fast :-). -- Knute Johnson