-
Bug
-
Resolution: Not an Issue
-
P4
-
None
-
1.0, 1.1.6, 1.2.0
-
generic, sparc
-
solaris_2.5
In the following sequence:
scrollPane.setScrollPosition(0,0);
Point pt = scrollPane.getScrollPosition();
does not leave pt as 0,0.
It isn't clear what the side effects of this are on hotjava, but it may
be the cause of some scrolling and repainting bugs.
--------------------------------- Reopen -----------------------------
Here is the example demonstrating the bug:
----------------Test.java---------------------
import java.awt.*;
public class Test {
public static void main(String [] args) {
Point p;
Frame frame = new Frame();
frame.setBounds(100,100,100,100);
ScrollPane sp = new ScrollPane(ScrollPane.SCROLLBARS_AS_NEEDED);
Canvas canvas = new Canvas();
canvas.setSize(300,300);
sp.add(canvas);
frame.add("Center",sp);
frame.setVisible(true);
for (int i=0;i<1000;i++) {
p = new Point(i%100,i%100);
sp.setScrollPosition(p);
if (!sp.getScrollPosition().equals(p)) {
System.out.println("Test Failed.");
System.out.println(i+" : Expected "+p+", but Returned: "+sp.getScrollPosition());
frame.dispose();
System.exit(0);
}
}
System.out.println("Test Passed.");
frame.dispose();
}
}
-- The output ----------------
#>java Test
Test Failed.
15 : Expected java.awt.Point[x=15,y=15], but Returned: java.awt.Point[x=12,y=15
------------------------------
###@###.### 1998-01-23
scrollPane.setScrollPosition(0,0);
Point pt = scrollPane.getScrollPosition();
does not leave pt as 0,0.
It isn't clear what the side effects of this are on hotjava, but it may
be the cause of some scrolling and repainting bugs.
--------------------------------- Reopen -----------------------------
Here is the example demonstrating the bug:
----------------Test.java---------------------
import java.awt.*;
public class Test {
public static void main(String [] args) {
Point p;
Frame frame = new Frame();
frame.setBounds(100,100,100,100);
ScrollPane sp = new ScrollPane(ScrollPane.SCROLLBARS_AS_NEEDED);
Canvas canvas = new Canvas();
canvas.setSize(300,300);
sp.add(canvas);
frame.add("Center",sp);
frame.setVisible(true);
for (int i=0;i<1000;i++) {
p = new Point(i%100,i%100);
sp.setScrollPosition(p);
if (!sp.getScrollPosition().equals(p)) {
System.out.println("Test Failed.");
System.out.println(i+" : Expected "+p+", but Returned: "+sp.getScrollPosition());
frame.dispose();
System.exit(0);
}
}
System.out.println("Test Passed.");
frame.dispose();
}
}
-- The output ----------------
#>java Test
Test Failed.
15 : Expected java.awt.Point[x=15,y=15], but Returned: java.awt.Point[x=12,y=15
------------------------------
###@###.### 1998-01-23
- duplicates
-
JDK-4106195 ScrollPane.setScrollPosition() does not always set position correctly
- Closed
- relates to
-
JDK-5049000 java.awt.ScrollPane.getScrollPosition works wrong sometimes
- Closed