In this piece of code i just simple display the host name and ipaddress from database. Now i want to add check boxes there for any kind of selection that first there comes a check box then there is a hostname and ipadress in front of that checkbox how can i do that kindly help me
private void HomeActionPerformed(java.awt.event.ActionEvent evt) {
jTextArea1.setText("Clients ID\t\t\tClients Name\t\t\tClients IPAddress\n");
int i=0;
sh1 = new JCheckBox();
Connection conn=MySqlConnect.ConnectDB();
String Sql="Select * from clients";
try
{
PreparedStatement pst=conn.prepareStatement(Sql);
ResultSet rs=pst.executeQuery();
while(rs.next())
{
String str=rs.getString("hostname");
String str1=rs.getString("ipaddress");
i=i+1;
jTextArea1.append(i+"\t\t\t"+str+"\t\t\t"+str1+"\n");
}
}
catch(Exception e)
{
JOptionPane.showMessageDialog(null,e);
}
}