Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4752650

Touchscreen: Swing loses MOUSE_RELEASED, action events

XMLWordPrintable

    • x86
    • linux



      Name: jk109818 Date: 09/24/2002


      FULL PRODUCT VERSION :
      java version "1.4.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
      Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)

      FULL OPERATING SYSTEM VERSION :
      glibc-2.2.4-19.3
      Kernel version 2.4.9-31
      Red Hat Linux release 7.2 (Enigma)

      ADDITIONAL OPERATING SYSTEMS :


      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Microtouch and Elographics touchscreens, configured using TSI'S
      xtouch and XFree86's elographics drivers respectively. These make the
      screen touch events look like mouse clicks to X.

      A DESCRIPTION OF THE PROBLEM :
      When running a PC (Linux, X Windows) equipped with a
      touchscreen, Swing sometimes loses the mouse release events. A
      mouse listener or EventQueue will see a MOUSE_PRESSED event
      but no matching MOUSE_RELEASED event. Visually, the button
      will get pressed but never released (until touched again).
        Programmatically, the button's action listeners will never get their
      actionPerformed() called.

      This could be caused by the event sequence being different with a
      touchscreen. A screen touch will trigger in X a mouse pressed event
      followed by a mouse move event followed by a mouse released
      event. When clicking with a mouse, a mouse pressed event is
      followed immediately by a mouse released event.

      While this does not happen often, users are much put off by this.
      When they push a button, they expect some sort of action. For a
      button to push in but do nothing is confusing. Yet a
      touchscreen-based GUI needs to be button intensive.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run the included source code and tap the button on a touchscreen for
      a couple of minutes. Eventually, you will see the button push in but not
      back out.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      All button depressions should pop back up. Occasionally, the button
      will seem to get stuck.

      REPRODUCIBILITY :
      This bug can be reproduced rarely.

      ---------- BEGIN SOURCE ----------
      import java.awt.*;
      import javax.swing.*;

      class foo
      {
         static public void main(String[] args)
         {
            JFrame frame = new JFrame();
            Container content = frame.getContentPane();
            content.add(new JButton("Push me!"));
            frame.setVisible(true);
         }
      }
      ---------- END SOURCE ----------
      (Review ID: 164920)
      ======================================================================

            dav Andrei Dmitriev (Inactive)
            jkimsunw Jeffrey Kim (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: