-
Bug
-
Resolution: Fixed
-
P4
-
1.2.0
-
1.2fcs
-
sparc
-
solaris_2.5.1
-
Verified
Name: akC57697 Date: 06/22/98
The RepaintManager.currentManager() does not return the manager that
was previously set.
The doc says:
"
public static RepaintManager currentManager(JComponent comp)
Return the RepaintManager for the calling thread.
public static void setCurrentManager(RepaintManager aRepaintManager)
Set the RepaintManager that should be used for the calling
thread. aRepaintManager will become the current RepaintManager
for the calling thread's thread group.
"
The example:
------------------------------8-<--------------------------------------------
import com.sun.java.swing.RepaintManager;
public class Test {
public static void main(String[] argv) {
com.sun.java.swing.JComponent comp = new com.sun.java.swing.JButton();
RepaintManager c = new RepaintManager();
RepaintManager newm = new RepaintManager();
RepaintManager res = null;
res = c.currentManager(comp); // Get prev. manager
c.setCurrentManager(newm); // Set the manager
res = c.currentManager(comp); // Get the manager
if (res!=newm) { // verify setting
System.out.println("The current manager is :"+res.getClass().getName()+ "@" +
Integer.toHexString(res.hashCode()));
System.out.println("expected :"+newm.getClass().getName()+ "@" +
Integer.toHexString(newm.hashCode()));
System.exit(0);
}
System.out.println("OKAY");
System.exit(0);
}
}
---------------------------->-8----------------------------------------------
Output:
The current manager is :com.sun.java.swing.RepaintManager@a547ff8b
expected :com.sun.java.swing.RepaintManager@6ed3ff8b
java full version "JDK-1.2beta4-J"
======================================================================