FileDocCategorySizeDatePackage
WindowUtil.javaAPI DocJMF 2.1.1e1744Mon May 12 12:20:44 BST 2003com.sun.media.util

WindowUtil

public final class WindowUtil extends Object

Fields Summary
private static int
jawtAvail
Constructors Summary
Methods Summary
public static native booleancanUseXIL(boolean greenOnlyVM)

public static intgetJAWTAvail()

	return jawtAvail;
    
public static native intgetWindowHandle(java.awt.Component c, int jawt)

public static intgetWindowHandle(java.awt.Component c)

     
	String javaVersion = null;
	String subver = null;
	int len = 0;
	try {
	    javaVersion = (String)System.getProperty("java.version");
	    if ( javaVersion.length() < 3)
		len = javaVersion.length();
	    else
		len = 3;
	    subver = javaVersion.substring(0,len);
	} catch (Throwable t) {
	    javaVersion = null;
	    subver=null;
	}
	
	if ( subver == null || subver.compareTo("1.3") <= 0) {
	    jawtAvail = 0;
	} else {
	    jawtAvail = 1;
	}
	
	try {
	    if (jawtAvail == 1)
		JMFSecurityManager.loadLibrary("jawt");
	} catch (Exception e) {
	    // Ignore the exception: most likely because jawt had
	    // already been loaded.
	} catch (UnsatisfiedLinkError e) {
	    // Ignore the exception: most likely because jawt had
	    // already been loaded.
	}

	try {
	    JMFSecurityManager.loadLibrary("jmutil");
	} catch (Exception e) {
	    System.err.println("Could not load library jmutil native module");
	    e.printStackTrace();
	} catch (UnsatisfiedLinkError ule) {
	    System.err.println("Could not load library jmutil native module");
	    ule.printStackTrace();
	}
    
	return getWindowHandle(c, jawtAvail);
    
public static native booleanisUltra()