Centering a JLabel on a JPanel

后端 未结 5 826
花落未央
花落未央 2020-11-22 14:32

I\'m using the NetBeans GUI builder to handle my layout (I\'m terrible with LayoutManagers) and am trying to place a simple JLabel so that it is always centered (horizontall

5条回答
  •  忘了有多久
    2020-11-22 15:05

    Mara: "thanks for your response, however the NetBeans GUI Build uses GroupLayout and this is not overridable."

    Not true! Right click anywhere inside JFrame (or any other GUI container) in NetBeans GUI builder and select "Set Layout". By default is selected "Free Design", which is Group layout, but you can select any other layout including Border layout as advised by mKorbel.

提交回复
热议问题