Path: csiph.com!aioe.org!eternal-september.org!feeder.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Daniele Futtorovic Newsgroups: comp.lang.java.programmer Subject: Re: What's the difference between mouseClicked and mousePressed? Date: Tue, 23 Jan 2018 19:41:59 +0100 Organization: A noiseless patient Spider Lines: 12 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 Content-Transfer-Encoding: 7bit Injection-Date: Tue, 23 Jan 2018 18:42:03 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="6e95f861c1860eea55e7b55e9dfb22b8"; logging-data="17163"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18CdLJ1mUGI2YQV04qyJm17" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 In-Reply-To: X-Antivirus-Status: Clean Content-Language: en-GB X-Antivirus: AVG (VPS 180123-8, 01/23/2018), Outbound message Cancel-Lock: sha1:X2N0S506hJCkZ0WPCctspaYtkTc= Xref: csiph.com comp.lang.java.programmer:37985 On 2018-01-23 15:47, Eric Douglas wrote: > On Tuesday, January 23, 2018 at 9:36:07 AM UTC-5, Eric Douglas wrote: > I'm not seeing the point to mouseClicked since it doesn't appear to work with touch events and I'm testing our application on a Surface Pro. If I'm looking for single click I can use mouseReleased and for double click I can use mousePressed and get the same result? > Oddly mouseClicked will only tell you if you got a single mousePressed immediately followed by a mouseReleased in the same location, but both of those events translate to touch events while mouseClicked does not? Check the Javadoc for java.awt.event.MouseEvent. Also, MouseEvent has a #getClickCount(). Might be what you're looking for. -- DF.