1. /*
  2. * @(#)NativeLibLoader.java 1.4 01/11/29
  3. *
  4. * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package java.awt.event;
  8. class NativeLibLoader {
  9. /**
  10. * This is copied from java.awt.Toolkit since we need the library
  11. * loaded in sun.awt.image also:
  12. *
  13. * WARNING: This is a temporary workaround for a problem in the
  14. * way the AWT loads native libraries. A number of classes in this
  15. * package (sun.awt.image) have a native method, initIDs(),
  16. * which initializes
  17. * the JNI field and method ids used in the native portion of
  18. * their implementation.
  19. *
  20. * Since the use and storage of these ids is done by the
  21. * implementation libraries, the implementation of these method is
  22. * provided by the particular AWT implementations
  23. * (i.e. "Toolkit"s/Peer), such as Motif, Win32 or Tiny. The
  24. * problem is that this means that the native libraries must be
  25. * loaded by the java.* classes, which do not necessarily know the
  26. * names of the libraries to load. A better way of doing this
  27. * would be to provide a separate library which defines java.awt.*
  28. * initIDs, and exports the relevant symbols out to the
  29. * implementation libraries.
  30. *
  31. * For now, we know it's done by the implementation, and we assume
  32. * that the name of the library is "awt". -br.
  33. */
  34. static void loadLibraries() {
  35. java.security.AccessController.doPrivileged(
  36. new sun.security.action.LoadLibraryAction("awt"));
  37. }
  38. }