kindly suggest how to use multiple checkboxes using else if in java and please check the code below

```
if(cb1.isSelected())
MyFrame9 m1=new MyFrame9();
else if(cb2.isSelected())
MyFrame10 m1=new MyFrame10();
else if(cb3.isSelected())
MyFrame11 m1=new MyFrame11();
else if(cb4.isSelected())
MyFrame12 m1=new MyFrame12();
else if(cb1.isSelected() && cb2.isSelected())
MyFrame13 m1=new MyFrame13();
else if(cb1.isSelected() && cb3.isSelected())
MyFrame14 m1=new MyFrame14();
else if(cb1.isSelected() && cb4.isSelected())
MyFrame15 m1=new MyFrame15();
else if(cb2.isSelected() && cb3.isSelected())
MyFrame16 m1=new MyFrame16();
else if(cb2.isSelected() && cb4.isSelected())
MyFrame17 m1=new MyFrame17();
else if(cb3.isSelected() && cb4.isSelected())
MyFrame18 m1=new MyFrame18();
else if(cb1.isSelected() && cb2.isSelected() && cb3.isSelected())
MyFrame19 m1=new MyFrame19();
else if(cb1.isSelected() && cb2.isSelected() && cb4.isSelected())
MyFrame20 m1=new MyFrame20();
else if(cb2.isSelected() && cb3.isSelected() && cb4.isSelected())
MyFrame21 m1=new MyFrame21();
else if(cb3.isSelected() && cb4.isSelected() && cb1.isSelected())
MyFrame22 m1=new MyFrame22();
else(cb1.isSelected() && cb2.isSelected() && cb3.isSelected() && cb4.isSelected())
MyFrame23 m1=new MyFrame23();
}

```