mardi 6 octobre 2015

How to save entire object for a checkbox in javafx

I have number of objects. Let's say i have 10 Books object and i want user to select any number of the book. When user press the submit button i want to retrieve all the books "object" that user selected.

As of now, while showing screen to user i use

CheckBox cb= new CheckBox(book.getName());

this shows bookname to user and user selects the book. But on runtime i will be needing bookid and other properties of book object as well.

Is there anyway through which i can save the book object in the checkbox?




Aucun commentaire:

Enregistrer un commentaire