import java.awt.Color;
import java.util.Vector;
import javax.swing.GroupLayout;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.border.Border;
import javax.swing.border.LineBorder;
public class Elementcharakteristik {
public static void main (String[] args)
{
JLabel jLabel;
JPanel panel=new JPanel();
GroupLayout layout = new GroupLayout(panel);
Border border = LineBorder.createBlackLineBorder();
Vector<JLabel> JCBKategorie = new Vector<JLabel>();
for (int i = 0; i < 10; i++)
{
jLabel = new JLabel(" "+i+" ");
jLabel.setFont(new java.awt.Font("Tahoma", 0, 23));
jLabel.setOpaque(true);
jLabel.setBackground(Color.blue);
jLabel.setForeground(Color.white);
jLabel.setBorder(border);
JCBKategorie.add(jLabel);
}
Vector<JLabel> JCBKategorie2 = new Vector<JLabel>();
for (int i = 0; i < 10; i++)
{
jLabel = new JLabel(" ");
jLabel.setFont(new java.awt.Font("Tahoma", 0, 23));
jLabel.setOpaque(true);
jLabel.setBackground(Color.blue);
jLabel.setBorder(border);
JCBKategorie2.add(jLabel);
}
GroupLayout.ParallelGroup PG = layout.createParallelGroup(GroupLayout.Alignment.LEADING);
GroupLayout.SequentialGroup SG = layout.createSequentialGroup();
for (int j = 0; j < JCBKategorie.size(); j++)
{
PG.addComponent(JCBKategorie.get(j));
}
Vector<GroupLayout.ParallelGroup> gruppe1 = new Vector<GroupLayout.ParallelGroup>();
for(int i=0; i<10;i++)
{
gruppe1.add(PG);
}
for (int j = 0; j < JCBKategorie.size(); j++)
{
SG.addComponent(JCBKategorie.get(j));
}
Vector<GroupLayout.SequentialGroup> gruppe2 = new Vector<GroupLayout.SequentialGroup>();
for(int i=0; i<10;i++)
{
gruppe2.add(SG);
}
JFrame f = new JFrame();
f .setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
f.setSize( 600, 600 );
f.add( panel);
f.setVisible( true );
layout.setVerticalGroup(layout.createSequentialGroup()
.addGroup(gruppe1.get(0))
.addGroup(gruppe1.get(1))
.addGroup(gruppe1.get(2)));
layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addGroup(gruppe2.get(0))
.addGroup(gruppe2.get(1))
.addGroup(gruppe2.get(2)));
layout.setAutoCreateGaps(true);
panel.setLayout(layout);
}
}