JDK-8091997 : Cannot select TableCell text or label text
  • Type: Enhancement
  • Component: javafx
  • Sub-Component: controls
  • Affected Version: fx2.0
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2011-10-21
  • Updated: 2018-09-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Relates :  
Relates :  
Description
It would be great if there was an option to allow highlighting text in a TableView for the purpose of allowing a user to copy text that is displayed in the cells. Selecting text from labels would also be beneficial. 
Comments
As long as it's on the list, then that's fine. It'd help make JavaFX more competitive with html interfaces.
06-09-2012

That would require support for continuous selection of a text flow across multiple nodes in a general scene graph. This is not likely to be implemented anytime soon. Of course, this could be achieved by using a WebView node with HTML instead of a TableView.
06-09-2012

There are instances where I'd like to allow a user to copy the text of an entire table and not just one cell of it.
06-09-2012

If it is sufficient to just be able to copy the whole content of the Labeled control to the clipboard - without the ability to select parts of it - then you can just add a context menu with a Copy command and the following action: ClipboardContent content = new ClipboardContent(); content.putString(labeled.getText()); Clipboard.getSystemClipboard().setContent(content);
06-09-2012

See evaluation of RT-15047.
09-11-2011

That's good to know. Perhaps the change to the API could be changing the name of that method then. Others will surely be confused and not know the full potential of the cells.
09-11-2011

Yes, you can use Cell.setGraphic(TextField). Here's an excerpt from Javadoc: "Because by far the most common use case for cells is to show text to a user, this use case is specially optimized for within Cell. This is done by Cell extending from Labeled. This means that subclasses of Cell need only set the text property, rather than create a separate Label and set that within the Cell. However, for situations where something more than just plain text is called for, it is possible to place any Node in the Cell graphic property. Despite the term, a graphic can be any Node, and will be fully interactive. For example, a ListCell might be configured with a Button as its graphic. The Button text could then be bound to the cells item property. In this way, whenever the item in the Cell changes, the Button text is automatically updated. "
09-11-2011

What about the cells of a table? I can't put a read-only text field in those.
09-11-2011

May be considered for a later release. In the meantime, use a read-only TextField instead (maybe with a modified style).
09-11-2011

This sounds more like a request for selection to be supported on Labeled controls, reassigning to Leif for review.
09-11-2011