-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
1.1, 1.1.1
-
None
-
sparc
-
solaris_2.5.1
Name: sgC58550 Date: 03/19/97
The attached code demonstrates the bug. When the event handler
for a Motif Scrollbar takes a large amount of time to run, and
the Scrollbar is sending UNIT_INCREMENT or UNIT_DECREMENT events,
extra events are sometimes generated by the bar. Thus, single
clicks on the scrollbar arrows will generate multiple scroll
events. In some cases, a cascade of events will drive the
scrollbar to the end.
In my example, I use a sleep to simulate a large amount of
processing by the event handler, but I am careful to space out
my mouse clicks so that they do not arrive during a sleep.
The problem occurs when the AWT window is running on the
local machine, and also on a remote X server.
I note that this bug is similar to 4028490, but it does not
involve Win32, does not involve multiple clicks, and single
spurious events can be generated instead of a cascade.
Test case:
import java.awt.*;
import java.awt.event.*;
public class MainTest extends Frame {
public MainTest() {
this.addWindowListener(
new WindowAdapter() {
public void windowClosing(WindowEvent event) {
System.exit(0);
}
}
);
class MAL implements AdjustmentListener {
public void adjustmentValueChanged(AdjustmentEvent e) {
System.out.println("Scrollbar event " + count++ + " caught");
Thread myThread = Thread.currentThread();
try {
myThread.sleep(400);
} catch (InterruptedException x ) {
}
System.out.println("Done sleeping");
}
}
Scrollbar myBar = new Scrollbar(Scrollbar.VERTICAL, 0, 6, 0, 80);
myBar.setBlockIncrement(1);
myBar.setUnitIncrement(1);
this.add("East", myBar);
myBar.addAdjustmentListener(new MAL());
}
public static void main(String args[]) {
Frame f = new MainTest();
f.setSize(500, 500);
f.show();
}
private int count = 0;
}
company - Lembersky-Chi Inc. , email - ###@###.###
======================================================================
- duplicates
-
JDK-4048060 Scrolling won't stop on sparc-S2 AWT
-
- Closed
-