@@ -26,13 +26,12 @@ public static void main(String[] args) {
2626 public void start (Stage stage ) throws Exception {
2727 root = new StackPane ();
2828
29- Scene s = new Scene (root , 400 , 300 );
29+ Scene s = new Scene (root , 800 , 600 );
3030 stage .setScene (s );
3131 stage .setTitle ("TestWindow" );
3232
3333 stage .show ();
3434 this .stage = stage ;
35- stage .setResizable (false ); // not allow to resize
3635
3736 this .initWv ();
3837 }
@@ -43,16 +42,18 @@ private void initWv() throws InvocationTargetException, NoSuchMethodException, I
4342 wv = new Webview (true , new PointerByReference (FXStageDetect .getWindowPointer (stage )),
4443 (int )s .getWidth (), (int )s .getHeight ());
4544 wv .setTitle ("TestWindow" );
45+ // note: not allow to resize
46+ wv .setFixedSize ((int )s .getWidth (), (int )s .getHeight ());
4647
4748 bindJs ();
4849
4950 // bind resize (not working)
50- s .widthProperty ().addListener ((observable , oldValue , newValue ) -> {
51- wv .setSize (newValue .intValue (), (int )s .getHeight ());
52- });
53- s .heightProperty ().addListener ((observable , oldValue , newValue ) -> {
54- wv .setSize ((int )s .getWidth (), newValue .intValue ());
55- });
51+ // s.widthProperty().addListener((observable, oldValue, newValue) -> {
52+ // wv.setSize(newValue.intValue(), (int)s.getHeight());
53+ // });
54+ // s.heightProperty().addListener((observable, oldValue, newValue) -> {
55+ // wv.setSize((int)s.getWidth(), newValue.intValue());
56+ // });
5657
5758 // 关闭
5859 stage .setOnCloseRequest (e -> {
0 commit comments