Java setResizable(false) changes the window size (swing)

前端 未结 7 761
情深已故
情深已故 2020-12-09 17:45

I have a strange problem. I am using the null layout for a window (= JFrame and on windows) and if I use setResizable (false) the window size gets bigger (to right and botto

7条回答
  •  轮回少年
    2020-12-09 18:05

    I have a 2 JFrame subclasses defined. If I run the problem frame in a standalone app, the frame size is correct. If I run both frames in a standalone app, the problem frame is still larger. I did setResizable(false) before pack, and I still get the problem. My workaround was to change the layout to BorderLayout and plop the (image) panel in the center, then did the setResizable.

提交回复
热议问题