JFrame resizable height ONLY

后端 未结 7 1478
我在风中等你
我在风中等你 2020-12-15 13:16

JFrame.setResizable(true) lets the user resize both the width and height of a window. Does a method exist which allows the user to ONLY resize the height?

7条回答
  •  再見小時候
    2020-12-15 13:23

    Instead of setResizable(true) use setResizable(false) Infact setResizable(false) did the trick for me. It even disabled maximization (dimmed the icon)

    Okay, I should have explained myself better. I wanted to get the resizeable thing working too. That's why I landed on this question. But I finally went with this, thought that would help the OP.

    I wanted to do resizable too, but thought if I can't get resizable to work, disabling is better because it won't mess up your content placement. Thought I'd suggest that as a solution.

提交回复
热议问题