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;
}
}
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);
}
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";
}
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);
}
Aggregations