Search in sources :

Example 51 with Toolkit

use of java.awt.Toolkit in project beast-mcmc by beast-dev.

the class BeagleSequenceSimulatorApp method CreateImage.

// END: main
private Image CreateImage(String path) {
    URL imgURL = this.getClass().getResource(path);
    Toolkit kit = Toolkit.getDefaultToolkit();
    Image img = kit.createImage(imgURL);
    if (img != null) {
        return img;
    } else {
        System.out.println("Couldn't find file: " + path + "\n");
        return null;
    }
}
Also used : Toolkit(java.awt.Toolkit) Image(java.awt.Image) URL(java.net.URL)

Example 52 with Toolkit

use of java.awt.Toolkit in project vcell by virtualcell.

the class FRAPClipboard method sendToClip.

public void sendToClip() {
    // Gets tools from system.
    Toolkit tools = Toolkit.getDefaultToolkit();
    Clipboard clip = tools.getSystemClipboard();
    clip.setContents(this, this);
}
Also used : Toolkit(java.awt.Toolkit) Clipboard(java.awt.datatransfer.Clipboard)

Example 53 with Toolkit

use of java.awt.Toolkit in project sulky by huxi.

the class TaskManagerTest method setUp.

@Before
public void setUp() {
    Toolkit tk = Toolkit.getDefaultToolkit();
    if (logger.isDebugEnabled())
        logger.debug("Toolkit: {}", tk);
    instance = new TaskManager<>();
    taskName = "TaskName";
}
Also used : Toolkit(java.awt.Toolkit) Before(org.junit.Before)

Example 54 with Toolkit

use of java.awt.Toolkit in project ginkgo-jdbc by georgeworld.

the class JdbcMain method setWindowCenter.

/*
     * 使窗口居中显示
     */
public static void setWindowCenter(Window window) {
    Toolkit kit = Toolkit.getDefaultToolkit();
    Dimension screenSize = kit.getScreenSize();
    int width = (int) screenSize.getWidth();
    int height = (int) screenSize.getHeight();
    int w = window.getWidth();
    int h = window.getHeight();
    window.setLocation((width - w) / 2, (height - h) / 2);
}
Also used : Toolkit(java.awt.Toolkit) Dimension(java.awt.Dimension)

Aggregations

Toolkit (java.awt.Toolkit)54 Dimension (java.awt.Dimension)13 Image (java.awt.Image)12 Point (java.awt.Point)10 URL (java.net.URL)9 BufferedImage (java.awt.image.BufferedImage)8 GraphicsDevice (java.awt.GraphicsDevice)7 GraphicsEnvironment (java.awt.GraphicsEnvironment)6 Insets (java.awt.Insets)4 Field (java.lang.reflect.Field)4 SunToolkit (sun.awt.SunToolkit)4 Rectangle (java.awt.Rectangle)3 IOException (java.io.IOException)3 BorderLayout (java.awt.BorderLayout)2 Container (java.awt.Container)2 Frame (java.awt.Frame)2 GradientPaint (java.awt.GradientPaint)2 Graphics2D (java.awt.Graphics2D)2 GraphicsConfiguration (java.awt.GraphicsConfiguration)2 HeadlessException (java.awt.HeadlessException)2