How to add support for resizing when using an undecorated JFrame?

前端 未结 3 1466
既然无缘
既然无缘 2020-12-16 19:13

I would like to customize my titlebar, minimize-, maximize- and the close-button. So I used setUndecorated(true); on my JFrame, but I still want to be able to r

3条回答
  •  臣服心动
    2020-12-16 19:54

    I found a nice method in RootPane that gave me this functionality, so now I only have to find out how to customize the titlebar and the buttons on it.

    I added this.getRootPane().setWindowDecorationStyle(JRootPane.FRAME); in my constructor for UndecoratedFrame.

    There is some more reading about this on Sexy Swing App – The Unified Toolbar and How to control window decorations

提交回复
热议问题