1 final JPanel labelPanel = new JPanel(new BorderLayout());
2 panel.add(labelPanel, BorderLayout.NORTH);
3
4 JLabel[] dashedLineLabel = new JLabel[wordLength];
5
6 for (int i = 0; i < wordLength; i++)
7 {
8 dashedLineLabel[i] = new JLabel("__ ");
9 dashedLineLabel[i].setFont(new Font("Serif", Font.BOLD, 30));
10 labelPanel.add(dashedLineLabel[i]);
11 }
12