Results 1 to 8 of 8
  1. #1
    jdh9862 is offline Member
    Join Date
    Nov 2010
    Posts
    1
    Rep Power
    0

    Default Touch Screen Libraries

    Can anyone point me to a free library of controls built for touch screens. By which I mean normal controls, like JTextField, adapted to be easy to use on a small touch screen device. For example if you were to enter a JTextField an on-screen keyboard would appear.

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    4,142
    Rep Power
    10

    Default

    Isn't a touchscreen pretty much a mouse input? So wouldn't you just want to use standard MouseListeners and whatnot?

  3. #3
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,951
    Blog Entries
    7
    Rep Power
    22

    Default

    Quote Originally Posted by KevinWorkman View Post
    Isn't a touchscreen pretty much a mouse input? So wouldn't you just want to use standard MouseListeners and whatnot?
    Not really, a finger can't 'hover over' the screen, i.e. a finger is there or it isn't. If it touches the screen you can implement a 'mouse moved' event. More expensive devices might 'see' a finger when it doesn't really touch the screen. Multiple finger detection is even more expensive.

    kind regards,

    Jos
    I have the stamina of a seal; I lie on the beach instead of running on it.

  4. #4
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    4,142
    Rep Power
    10

    Default

    Quote Originally Posted by JosAH View Post
    Not really, a finger can't 'hover over' the screen, i.e. a finger is there or it isn't. If it touches the screen you can implement a 'mouse moved' event. More expensive devices might 'see' a finger when it doesn't really touch the screen. Multiple finger detection is even more expensive.

    kind regards,

    Jos
    Hmm, fair enough. But as far as a basic touch screen input device and Java, aren't standard MouseEvents a good place to start?

  5. #5
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,370
    Rep Power
    21

    Default

    What does Android use?

  6. #6
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,951
    Blog Entries
    7
    Rep Power
    22

    Default

    Quote Originally Posted by KevinWorkman View Post
    Hmm, fair enough. But as far as a basic touch screen input device and Java, aren't standard MouseEvents a good place to start?
    Yep (I know those things because I've been there, done that ;-) but don't expect any mouse move events when the finger doesn't touch the screen; also there is no real mouse click event, there's only a finger touch, finger raised and finger moved event (if the coordinates have changed since the generation of the last event, and the finger hadn't left the screen).

    kind regards,

    Jos
    I have the stamina of a seal; I lie on the beach instead of running on it.

  7. #7
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    4,142
    Rep Power
    10

    Default

    Yeah, I wouldn't expect any events when the screen isn't being touched. But for the basics (which I think the OP is going for), even relying on mouse motion events might be good enough.

    I also guess I'd expect more modern touch screens to differentiate better between a mouse motion event and a mouse clicked event. I'd be curious about what Android does as well.

  8. #8
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,370
    Rep Power
    21

    Default

    It has its own Touch class and MotionEvent.
    It also has a gesture package.

    I'd forgotten I'd actually looked at some of this earlier this year...:)

    ETA: And the events seem to come through here.

Similar Threads

  1. Touch Displays
    By Ciwan in forum New To Java
    Replies: 4
    Last Post: 10-21-2010, 09:47 AM
  2. Touch recursion question
    By myst in forum New To Java
    Replies: 18
    Last Post: 06-08-2010, 06:48 PM
  3. How could Swing support multi-touch?
    By pianyao in forum AWT / Swing
    Replies: 2
    Last Post: 08-18-2009, 10:06 AM
  4. Blank Screen while navigating from one screen to another
    By mohana.krishna in forum Java Servlet
    Replies: 0
    Last Post: 03-03-2009, 06:03 PM
  5. Reading Libraries.
    By leiferouis in forum New To Java
    Replies: 4
    Last Post: 02-07-2009, 09:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •