编程语言
首页 > 编程语言> > JavaFX获取屏幕尺寸

JavaFX获取屏幕尺寸

作者:互联网

1 awt

Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
double width = screenSize.getWidth();
double height = screenSize.getHeight();

2 javafx

Rectangle2D screenRectangle = Screen.getPrimary().getBounds();
double width = screenRectangle.getWidth();
double height = screenRectangle.getHeight();

标签:screenRectangle,double,getHeight,JavaFX,height,width,尺寸,screenSize,屏幕
来源: https://www.cnblogs.com/6b7b5fc3/p/12996947.html