How do I open a JInternalFrame centered in a JDesktopPane?

后端 未结 5 1669
礼貌的吻别
礼貌的吻别 2021-01-05 09:21

I am adding a bunch of JInternalFrames into a JDesktopPane, as the user selects to open various features through the menus. But I would like the in

5条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-05 09:56

    If you are using Netbeans (which is recommended for desktop apps) you just need to:

    1. Select the form, right click and then properties;
    2. Go to code tab;
    3. Change "Form size policy" from "Generate Pack()" to "Generate Resize Code";
    4. Form Position (option above Form size policy) will be available.

    Now you can set the for position as you wish :)

提交回复
热议问题