I'm creating a databse application with SQL server management as the back end and the GUI in Netbeans. Based on the number of rows or tuples retrieved from the databse, I want to create those many radio buttons. Currently I've just come to this:
result = select.executeQuery("SELECT ......."); while(result.next()) { cpf=result.getString("CoursePrefix"); cnum=result.getString("CourseNumber"); String cname=result.getString("CourseName"); jRadioButton1.setText(cpf+" "+cnum+" "+cname); }
So, is there a way to to create radio buttons dynamically (something like jRadioButtoni.setText(cpf+" "+cnum+" "+cname)) where i is the number of tuples returned by the query in result.
Also, in the GUI builder I have to drag and drop the swing controls. I cannot declare teh components via the source code.
Any help and pointers in the direction will be greatly appreciated! Thanks!!