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();
阅读 525
283 声望
631 粉丝
0 条评论
你知道吗?

283 声望
631 粉丝
宣传栏