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 15:48:56 -0600 Organization: A noiseless patient Spider Lines: 22 Message-ID: References: <65e683ec-444d-4a80-b3b4-e6de98bacc5e@googlegroups.com> <46ceca25-eec6-41b4-b304-f5424800b9eb@googlegroups.com> <3ce5cf06-6cfa-4baf-b459-3751a6dcd195@googlegroups.com> <4740811d-907d-42c3-aefe-45189d3a1d57@googlegroups.com> <751cc038-6f80-4eb4-9725-2af8d5a71ed1@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 21:48:59 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="4c5f3bf66be9b9360a617420a80b49f6"; logging-data="5093"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18fqE2HnIJaxJX7PBVPKklv" User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 In-Reply-To: <751cc038-6f80-4eb4-9725-2af8d5a71ed1@googlegroups.com> Content-Language: en-US Cancel-Lock: sha1:z1BK7WO4ueYf2u3wVZmh1DBEiU4= Xref: csiph.com comp.lang.java.programmer:37993 On 1/23/2018 15:36, Eric Douglas wrote: > On Tuesday, January 23, 2018 at 4:18:53 PM UTC-5, Knute Johnson wrote: >>> >>> Yes I am processing touch events in Swing, no FX. >> >> I think that's the problem, there aren't any in Swing. >> >> -- >> >> Knute Johnson > > If switching our Swing controls to JavaFX controls is possible it would be ugly. > If Swing isn't supposed to handle the touch events, I don't know how they're converting. mousePressed and mouseReleased are getting called. I did find an old blog that says mouseClicked looks like a double tap, I'll have to test it again maybe tapping 4 times would process a mouseClicked double click. It does accept getClickCount()==2 from 2 taps in mousePressed or mouseReleased. > Try that JavaWS program that Eric S posted the link to. I get a mousePressed, mouseReleased and a mouseClicked just by touching the screen and lifting my finger. -- Knute Johnson