title: How to set individual cell tooltip/bind property to the tooltip for TableColumn in JavaFX
body: <p>I have a table where I want to display a tooltip for a specific column that correlates to a different value than the cell that the user is hovering over. I know normally, tooltips are set for the exact cell object value or another string. But I want to display a different value that correlates with each </p>
  
  <p>Like in the image shown, I'm displaying a "type" and I want the user to be able to hover over the individual "type" cell to view the "subtype" string as a tooltip. (Like in the image, but I want this to display the actual type and not a dummy string.) Both are defined in the IDisplayLayer Interface.</p>
  
  <p>I need to display the specific subtypeProperty in the tooltip, instead of a string. This subtype needs to be binded like how the normal PropertyValueFactory's bind the data. How can I bind this? Thanks in advance for any help/guidance. </p>
  
  <p><a href="https://i.stack.imgur.com/fa0kv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fa0kv.png" alt="image showing tooltip that needs to display &quot;subtype&quot; instead of string"></a> </p>
  
  <pre><code>        TableColumn&lt;IDisplayLayer, String&gt; type = new TableColumn&lt;&gt;("Type");
          PropertyValueFactory&lt;IDisplayLayer, String&gt; pvf2 = new PropertyValueFactory&lt;IDisplayLayer, String&gt;("layerType");
  
          type.setCellFactory
          (
            column -&gt;
             {
               return new TableCell&lt;IDisplayLayer, String&gt;()
                {
                  @Override
                  protected void updateItem(String item, boolean empty)
                   {
                      Tooltip tip = new Tooltip("This is a tooltip"); //where I need to set the value here
                      super.updateItem(item, empty);
                      setText(item);
                      setTooltip(tip);
                   }
                };
             });
  </code></pre>
  
  <p>Where both are defined: 
  public interface IDisplayLayer {</p>
  
  <pre><code>String getLayerType();
  void setLayerType(String s);
  StringProperty layerTypeProperty();
  
  String getLayerSubtype();
  void setLayerSubtype(String s);
  StringProperty layerSubtypeProperty();
  </code></pre>
  
  <p>}</p>