Posts

Showing posts from May, 2016

JavaFX 8 Tutorial 61 - Retrive Database Values Into CheckBox

Image
The code written in this tutorial is -                     // Retrive Hobbies Into CheckBox                                         if(rs.getString("Hobbies")!= null){                         checkBox1.setSelected(false);                         checkBox2.setSelected(false);                         checkBox3.setSelected(false);                                                 //hobbies in the string formate - [Playing , Dancing]                         System.out.println(rs.getString("Hobbies"));                                                 String checkBoxString = rs.getString("Hobbies").replace("[", "").replace("]", "");                         System.out.println(checkBoxString);                                                 //now can converert to a list, strip out commas and spaces                         List<String> hobbylist = Arrays.asList(checkBoxString.split("\\s*,\\s*"