Disable drag of JFrame

后端 未结 2 782
野性不改
野性不改 2020-12-21 17:26

I want to ask how to make frame can not drag when the application is running?

And then how to disable maximize, minimize button (title bar)?

I\'m using

2条回答
  •  离开以前
    2020-12-21 17:51

    Just add the below line it removes the window decorations like close maximise and minimise(titlebar). This itself disables the dragging only with mouse events.

    frame.setUndecorated(true);
    

提交回复
热议问题