Re: Java on a touchscreen
Depends on the tablet I presume.
I mean, if it's Android then you won't be using Swing anyway, and it has the whole UI framework based around touchscreens.
Re: Java on a touchscreen
Right, should've added that in the OP... It's a Windows tablet.
Re: Java on a touchscreen
I thought that might be the case, just wanted to be sure...:)
Single touch used to be treated as a mouse, where touching the screen is a mouse-down at that location, and then track the movement of the finger (which may result in a click event or not).
How you would handle multi-touch, though, I have no idea.
Re: Java on a touchscreen
I'm not too concerned with multi-touch (it'll be a rather simple application), so for now I'll just work under the assumption that it'll be identical to an application used with a mouse. Means I can develop it on my own computer instead of having to rely on a touchscreen device for running the application. Thanks for your help!
Re: Java on a touchscreen
For single touch screens you can't (easily) simulate 'right mouse clicks'. If you properly distinguish between 'finger down', 'finger up' and 'finger moved' events you can synthesize the events 'mouse pressed', 'mouse released', 'mouse entered' and 'mouse released' events. Components themselves should (optinally) synthesize them to a 'mouse clicked' event.
kind regards,
Jos
Re: Java on a touchscreen
Hmm. Good point on the rightclick... I hadn't actually thought about that one. Fortunately it shouldn't be hard to make this specific application without it though. Thanks!