h2.addComponent(jLabel1, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 512, Short.MAX_VALUE);
//Add a container gap to the sequential group h1
h1.addContainerGap();
// Add the group h2 to the group h1
h1.addGroup(h2);
h1.addContainerGap();
//Add the group h1 to hGroup
hGroup.addGroup(Alignment.TRAILING,h1);
//Create the horizontal group
layout.setHorizontalGroup(hGroup);