Well, if you cannot create a bean with JLabel, JTextField and JButton to host your group, you can always use Map in your main ui panel to register items when they are added. Some structure like
Map<K, List<Component>>
may work, where K is the group identifier. This way you separate the components from how they fit in ui.
source share