I cannot view shortcuts created dynamically. The code is as follows:
JLabel[] labels = new javax.swing.JLabel[cur.length]; for (int i = 0 ;i < cur.length; i++) { System.out.println("in"); labels[i] = new JLabel( cur[i] ); labels[i].setText(""+cur[i]); jPanel1.add(labels[i]); this.setVisible(true); } }
1. JPanel . getContentPane(). Add (jpanel1);2. JLabel . true. 3. JPanel flowlayout, CardLayout , , . jpanel1.setLayout( FlowLayout())4. this.setVisible(true) .
jPanel? , , FlowLayout. , , .