Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ChoiceBox cell factory?

zonskiNov 9 2011 — edited Nov 17 2011
Is there any reason why ChoiceBox doesn't use the same cell factory approach used by list/table/tree? Unless I'm missing something (?) it looks like the intention is that we should just add our nodes (i.e. cells) directly to the list of items.

This is a little odd for me, I would normally want to put my data elements (Beans or enums) in the ChoiceBox and have the renderer take care of the rest, just like I do with lists/tables/trees. In the current model I am having to iterate over my data items and create a custom cell for each one, then when something is selected, etc, I have to get the data item out of my custom cell. It all feels a tad awkward?

Edit: actually adding nodes doesn't seem to work either? I've resorted to creating a wrapper class for my Bean that provides a toString that does my formatting. In this approach, I also lose my underscores in my text (in the popup only, the button bit seems fine) - I assume this is something to do with mnemonics but I have not turned these on and can't see a simple way to turn them off. This all seems a bit wrong, what am I missing?
This post has been answered by Jonathan Giles-Oracle on Nov 15 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 15 2011
Added on Nov 9 2011
17 comments
2,456 views