• Post Reply Bookmark Topic Watch Topic
  • New Topic

SWT - Adding CheckBoxes to a list  RSS feed

 
Bhavani Kumar
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
can anyone tell me how to add checkboxes in a list ?
 
Rekha
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

go thru the following link for more info on creating list of check boxes.
http://manning.com/sbe/files/uts2/Chapter10html/Chapter10.htm

Regards,
Rajesh
 
Bhavani Kumar
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the help Rajesh ! But i was looking for how to add Checkboxes in SWT and not in Swing....a code snippet will be of great help.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JFace has a class called CheckBoxTableViewer that does what you want. There is an example of it in APress' SWT & JFace book. Sorry, but I don't have the time to type out all the code from the book.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I found the source code for the book online. You can download the source from here.

The example is in the chapter 14 file. The three files to look at are:

BackupContentProvider.java
BackupFileLableProvider.java
BackupFiles.java
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!