Results 1 to 5 of 5

Thread: Touch Displays

  1. #1
    Ciwan is offline Banned
    Join Date
    Dec 2008
    Location
    Earth
    Posts
    87
    Rep Power
    0

    Exclamation Touch Displays

    Hello

    I did some google searching on this, but could not find anything useful.

    When creating a program (with GUI) with Java code for a touch screen. Would I have to code differently ?

    I would greatly appreciate some help.

    Thank You.

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

    Default

    If you are using the standard Java libraries (Swing etc) then these are platform independent, so a touch screen can be treated just like any other pointing device.

    If you are going to rely on gestures (eg expand/shrink/scroll based on two points) then you either do some time based analysis or use some (non Java) way of getting that information from the hardware. I haven't actually written anything for devices that "pinch" etc so I wouldn't know how common or accessible they and their drivers are.

  3. #3
    Zack's Avatar
    Zack is offline Senior Member
    Join Date
    Jun 2010
    Location
    Destiny Islands
    Posts
    692
    Rep Power
    5

    Default

    Keep in mind that on a touch screen display, the "Mouse" object never moves steadily. When it's tapped, it moves to the position of the touch (on most systems, anyway), so the event X and Y will be accurate. (Also when holding down, I believe a dragging event is invoked.) Obviously, though, there is no way to track motion without the user touching the display.

    In general, no, you will not have to code differently.

  4. #4
    Ciwan is offline Banned
    Join Date
    Dec 2008
    Location
    Earth
    Posts
    87
    Rep Power
    0

    Default

    Cool

    Thank You Guys.

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

    Default

    Quote Originally Posted by pbrockway2 View Post
    If you are using the standard Java libraries (Swing etc) then these are platform independent, so a touch screen can be treated just like any other pointing device.
    Not really; most ordinary touch screens can only sense a finger/pen on screen or off screen; there is no notion of a button click. The screen can detect motion of the finger/pen but that's it. More expensive screens can detect multiple fingers/pens but they're not mainstream devices (yet).

    The more 'sophisticated' drivers mimick mouse clicks by organizing quick taps (on screen, off screen sequences) within a small time interval.

    kind regards,

    Jos

Similar Threads

  1. Replies: 5
    Last Post: 06-07-2014, 05:39 PM
  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. Replies: 0
    Last Post: 03-28-2008, 08:46 PM
  5. Problem when displays in the terminal
    By Felissa in forum Advanced Java
    Replies: 2
    Last Post: 07-01-2007, 02:14 AM

Posting Permissions

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