当前位置: 首页>>代码示例>>Java>>正文


Java SunToolkit.createNewAppContext方法代码示例

本文整理汇总了Java中sun.awt.SunToolkit.createNewAppContext方法的典型用法代码示例。如果您正苦于以下问题:Java SunToolkit.createNewAppContext方法的具体用法?Java SunToolkit.createNewAppContext怎么用?Java SunToolkit.createNewAppContext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sun.awt.SunToolkit的用法示例。


在下文中一共展示了SunToolkit.createNewAppContext方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: main

import sun.awt.SunToolkit; //导入方法依赖的package包/类
public static void main(final String[] args) throws Exception {
    final Thread t1 = new Thread(new ThreadGroup("firstGroup"), () -> {
        app1 = SunToolkit.createNewAppContext();
        test(true);
    });
    final Thread t2 = new Thread(new ThreadGroup("secondGroup"), () -> {
        app2 = SunToolkit.createNewAppContext();
        test(false);
    });

    t1.start();
    t2.start();
    t1.join();
    t2.join();
    app1.dispose();
    app2.dispose();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:18,代码来源:bug6190373.java

示例2: run

import sun.awt.SunToolkit; //导入方法依赖的package包/类
public void run()  {
    appContext = SunToolkit.createNewAppContext();
    created = true;
    synchronized(syncObject) {
        syncObject.notifyAll();
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:AppletClassLoader.java

示例3: main

import sun.awt.SunToolkit; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    SwingUtilities.invokeAndWait(new Runnable() {
        public void run() {
            editor = new JEditorPane("text/html", "Hello world!");
        }
    });

    Thread thread = new Thread(new ThreadGroup("Some ThreadGroup"), new Runnable() {
        public void run() {
            SunToolkit.createNewAppContext();

            try {
                SwingUtilities.invokeAndWait(new Runnable() {
                    public void run() {
                        editor.setText("Hello world!");
                    }
                });
            } catch (Exception e) {
                throw new RuntimeException(e);
            }

        }
    });

    thread.start();
    thread.join();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:28,代码来源:bug6990651.java

示例4: run

import sun.awt.SunToolkit; //导入方法依赖的package包/类
public void run() {
    SunToolkit.createNewAppContext();

    if (LayoutQueue.getDefaultQueue() == DEFAULT) {
        throw new RuntimeException("Sharing detected");
    }

    LayoutQueue.setDefaultQueue(new LayoutQueue());
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:Test6588003.java

示例5: run

import sun.awt.SunToolkit; //导入方法依赖的package包/类
public void run() {
    SunToolkit.createNewAppContext();
    ToolTipManager manager = ToolTipManager.sharedInstance();
    if (DISMISS != manager.getDismissDelay()) {
        throw new Error("shared dismiss delay");
    }
    if (INITIAL != manager.getInitialDelay()) {
        throw new Error("shared initial delay");
    }
    if (RESHOW != manager.getReshowDelay()) {
        throw new Error("shared reshow delay");
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:14,代码来源:Test6657026.java

示例6: run

import sun.awt.SunToolkit; //导入方法依赖的package包/类
public void run() {
    SunToolkit.createNewAppContext();
    try {
        testUIMap();
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:9,代码来源:bug6657138.java

示例7: createAppContext

import sun.awt.SunToolkit; //导入方法依赖的package包/类
private void createAppContext() {
    isCreated = false;
    final Runnable runnable = new Runnable() {
            public void run() {
                appContext = SunToolkit.createNewAppContext();
                synchronized (lock) {
                    isCreated = true;
                    lock.notifyAll();
                }
            }
        };

    final Thread thread = new Thread(threadGroup, runnable, "creates app context");
    synchronized (lock) {
        thread.start();
        while (!isCreated) {
            try {
                lock.wait();
            } catch (InterruptedException ie) {
                ie.printStackTrace();
            }
        }
    }

    if (appContext == null) {
        throw new RuntimeException("failed to create app context.");
    } else {
        System.out.println("app context was created.");
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:31,代码来源:Test8012933.java

示例8: run

import sun.awt.SunToolkit; //导入方法依赖的package包/类
public void run() {
    SunToolkit.createNewAppContext();

    try {
        validate();
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:bug6938813.java

示例9: run

import sun.awt.SunToolkit; //导入方法依赖的package包/类
public void run() {
    SunToolkit.createNewAppContext();

    try {
        setSelectedUIMethod.invoke(null, null, false, false, false, false);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:10,代码来源:bug7143614.java

示例10: run

import sun.awt.SunToolkit; //导入方法依赖的package包/类
@Override
public void run() {
    contextToDispose = SunToolkit.createNewAppContext();
    Frame f = new Frame();
    f.setSize(300, 300);
    f.setLocationRelativeTo(null);
    f.setVisible(true);
    thread = new Thread(() -> {
        while(true);
    });
    thread.start();
    sync();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:14,代码来源:ApplicationThreadsStop.java

示例11: main

import sun.awt.SunToolkit; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    SunToolkit.createNewAppContext();
    new Test8012933().test();
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:5,代码来源:Test8012933.java

示例12: run

import sun.awt.SunToolkit; //导入方法依赖的package包/类
public void run() {
    SunToolkit.createNewAppContext();
    test();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:5,代码来源:Test6657026.java

示例13: run

import sun.awt.SunToolkit; //导入方法依赖的package包/类
public void run() {
    SunToolkit.createNewAppContext();
    IS_PALETTE = JInternalFrame.CONTENT_PANE_PROPERTY;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:5,代码来源:Test6657026.java

示例14: run

import sun.awt.SunToolkit; //导入方法依赖的package包/类
public void run() {
    SunToolkit.createNewAppContext();
    JSlider slider = new JSlider();
    test(slider);
    tickLength = -10000;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:7,代码来源:Test6657026.java

示例15: main

import sun.awt.SunToolkit; //导入方法依赖的package包/类
public static void main(String... args) throws Exception {
    ThreadGroup rootTG = Thread.currentThread().getThreadGroup();
    while (rootTG.getParent() != null) {
        rootTG = rootTG.getParent();
    }

    ThreadGroup tg = new ThreadGroup(rootTG, "FakeApplet");
    final Thread t1 = new Thread(tg, "createNewAppContext") {
        @Override
        public void run() {
            try {
                AppContext context = SunToolkit.createNewAppContext();
            } catch(Throwable t) {
                thrown = t;
            }
        }
    };
    t1.start();
    t1.join();
    if (thrown != null) {
        throw new RuntimeException("Unexpected exception: " + thrown, thrown);
    }
    Thread t2 = new Thread(tg, "BugDetector") {

        @Override
        public void run() {
            try {
                Logger.getLogger("foo").info("Done");
            } catch (Throwable x) {
                thrown = x;
            }
        }

    };

    System.setSecurityManager(new SecurityManager());
    t2.start();
    t2.join();
    if (thrown != null) {
        throw new RuntimeException("Test failed: " + thrown, thrown);
    }

}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:44,代码来源:TestMainAppContext.java


注:本文中的sun.awt.SunToolkit.createNewAppContext方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。