I have completed my assignment and uploaded to lms
The only trick is to create the checkboxes array and use for(JCheckBox box: array) to get the checked values. then use sql query "Select * from Students where Grades IN('a','b');
I am giving the idea but not the whole assignment because i have been suffered by giving my assignment to some one and he upload to a website.
//check box array
private ArrayList<JCheckBox> sgrade = new ArrayList<JCheckBox>();
How to get the selected checkbox value and make a query:
string = ""; // create this variable in the class scope
for(JCheckBox jbox: sgrade){
if(box.isSelected()){
string += "'" + box.getText() + "'" + ",";
}
//this will get if a and b selected like this "'a','b'". Now we will put this string in our query
Note: that do not use PrepraedStatement. use only simple Statement
//sql query will be
String sql = "SELECT * FROM Students WHERE Grades IN("+string+")ORDER BY ID DESC ";

Now use some functions to simplify this assignment
BR
Farimarwat

Name:  assignment.jpg
Views: 13
Size:  120.9 KB