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

REGRESSION: DropTarget causes autoscroll method to enter into infinite loop

XMLWordPrintable

    • rc1
    • x86
    • linux, windows_2000
    • Verified



      Name: rmT116609 Date: 10/18/2001


      java version "1.4.0-beta2"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta2-b77)
      Java HotSpot(TM) Client VM (build 1.4.0-beta2-b77, mixed mode)

      If a darg&dropeable object implements the Autoscroll interface in 1.4.0-beta2 you get
      lost in an infinite loop in the public void autoscroll(Point pt) method.

      Look at the example: http://www.javaworld.com/javaworld/javatips/jw-javatip114.html

      Resize the window in order to get a scroll, and then drag a node on it.
      Try it on a jdk1.3.1_01, every thing is fine, but if you try with jdk1.4b2 then
      you get stuck in the method public void autoscroll(Point pt).

      I think that the DropTarget timer in charge of autoScrolling is not stoped, but
      I don't see why?

      Steps to reproduce:

      0] After downloading the source and compiling the 3 classes.
      1] Launch the application: java CTree
         You get a window with a JTree inside, 3 nodes (without the root).
         The window is big enought, resize the window in order to see
         only 2 nodes (color&sport for example).
      2] You should see the JScrollPane at the right of the window since the
         third node is not visible
      3] Select the node 'color' and drag it down (without dropping) until it
         autoscrolls to 'food', stay on 'food' and after it expands, drop
         your 'color' node at the end of food ('bananas')
      4] -> Bug: sroll bar are stuck, try to use them, and you will be
            replaced where you've done your last drop.

      Normal behaviour: after step 3] I should be able to use scroll bar.

      Note 1: in this example drop does nothing.
      Note 2: This problem does not occur with jdk1.3.1_01
      Note 3: This problem also occured with a JList instead of the JTree,
              so the problem seams to be in the DropTarget class.

      After looking at the thing more precisely, you will notice that the timer in charge of
      calling 'autoscroll(Point pt)' is not stopped so you get a 'scrollRowToVisible(nRow);'
      launch in a timer that disabled all normal moves. Thus, if you try an other drop, it
      seams that a second timer is started.

      (Review ID: 133885)
      ======================================================================

            dassunw Das Das (Inactive)
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: