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