How to locate JLabels to an absolute position on Java GUI

后端 未结 3 1752
醉话见心
醉话见心 2020-12-02 00:08

I have many JLabels (which includes ImageIcons) in a JPanel.

And this JPanel is only a panel on the GUI; there ar

3条回答
  •  萌比男神i
    2020-12-02 00:58

    Either

    • set a custom LayoutManager (Container.setLayout) on the panel that sets the exact positions you want or
    • set a null layout manager (myPanel.setLayout(null);) and set component positions externally (Component.setBounds).

提交回复
热议问题