Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8114893

isSelected always returns 'false' for TableColumn cell factories

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • 7u6
    • fx2.1
    • javafx
    • Javafx 2.1, Netbeans 7.1.2

      In this cell factory for a TableView column:

      public class NameFormatCell extends TableCell<Room,String> {

           public NameFormatCell() { }
             
           @Override protected void updateItem(final String item, boolean empty) {
               
               super.updateItem(item, empty);
               
               if (item != null) {
                   setText(item);
                   
                   setTextFill(isSelected() ? Color.WHITE : Color.BLACK);
                   setFont(Font.font("Segoe UI", FontWeight.BOLD, 18));
               }
           }
       }

      The cell always displays in Black, even if the row is selected in the TableView.

            jgiles Jonathan Giles
            enriquejfx Enrique (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: