The following code is compilng and runing with no errors.
It should add X textfiled to a panel( which is empty), where X is enterd by user
no component is added to the panel ( nothing that I can see - I change the color so it will be visible for sure).
What should I change?
Thanks,
Adi
private void jComboBoxSizeActionPerformed(java.awt.event.ActionEvent evt) {
if ("comboBoxChanged".equals(evt.getActionCommand())) {
String numStr=(String)jComboBoxSize.getSelectedItem();
int num = Integer.parseInt(numStr);
if (num > 0 )
PrintWordCell(num);
}
}
private void PrintWordCell( int num) {
MaskFormatter formatter=null;
try{
formatter = new MaskFormatter("?");
GridLayout gl=new java.awt.GridLayout(1,num);
jPanelWord.setLayout(gl);
WordToFind=new javax.swing.JTextField[num];
for ( int i=0; i<num;i++) {
WordToFind=new javax.swing.JTextField();
WordToFind.setBackground(new java.awt.Color(255,0,255));
jPanelWord.add(WordToFind);
}
CardLayout cl = (CardLayout)(Screens.getLayout());
cl.show(Screens,"CreateCross");
}
catch (java.text.ParseException x){
x.printStackTrace();
}
}
It should add X textfiled to a panel( which is empty), where X is enterd by user
no component is added to the panel ( nothing that I can see - I change the color so it will be visible for sure).
What should I change?
Thanks,
Adi
private void jComboBoxSizeActionPerformed(java.awt.event.ActionEvent evt) {
if ("comboBoxChanged".equals(evt.getActionCommand())) {
String numStr=(String)jComboBoxSize.getSelectedItem();
int num = Integer.parseInt(numStr);
if (num > 0 )
PrintWordCell(num);
}
}
private void PrintWordCell( int num) {
MaskFormatter formatter=null;
try{
formatter = new MaskFormatter("?");
GridLayout gl=new java.awt.GridLayout(1,num);
jPanelWord.setLayout(gl);
WordToFind=new javax.swing.JTextField[num];
for ( int i=0; i<num;i++) {
WordToFind=new javax.swing.JTextField();
WordToFind.setBackground(new java.awt.Color(255,0,255));
jPanelWord.add(WordToFind);
}
CardLayout cl = (CardLayout)(Screens.getLayout());
cl.show(Screens,"CreateCross");
}
catch (java.text.ParseException x){
x.printStackTrace();
}
}