I want to create a for loop that creates JPanel
containers with titled headers. the number of iterations depends on the user input from previous interfaces.
int noofpara=Integer.parseInt(data[6]);
for(int i=1;i<=noofpara;i++){
jPanel1.add(new JPanel().setBorder(new TitledBorder("Perimeter"+i)));
}
The noofpara
is the number of perimeters the user chose according to that the for loop should create panels with the titled border with the number of perimeters. the error appears at the jpanel1.add...
where it says void type not allowed.