Package mars.util

Class NativeUtilities

java.lang.Object
mars.util.NativeUtilities

public class NativeUtilities extends Object
  • Method Details

    • isUsingX11

      public static boolean isUsingX11()
      Determine whether AWT is currently running on the X11 windowing system. If so, most implementations of AWT classes are located in the internal package sun.awt.X11.
      Returns:
      true if the default toolkit is sun.awt.X11.XToolkit, or false otherwise.
    • setApplicationName

      public static void setApplicationName(String name)
      Set the name of the AWT application as a whole, if applicable. It is recommended that this method is called before any windows are shown, as the platform may not recognize the change otherwise.

      This does nothing for most platforms, but for some (namely X11), this method does the extra work to ensure that the name is properly set as desired.

      Parameters:
      name - The general application name, which appears on the taskbar and/or status bar on some platforms.
    • setApplicationIconImage

      public static void setApplicationIconImage(Image iconImage)
      Update the application icon displayed on the taskbar to the given image, if possible.

      This method does nothing for platforms which do not support the Taskbar API. Note that this is not a replacement for Window.setIconImage(Image), which sets the icon assigned for a particular window (also setting the application icon on some platforms).

      Parameters:
      iconImage - The new application icon, which will appear on the taskbar on some platforms.