Questions tagged [treecell]
16 questions
4
votes
2 answers
JavaFX-CSS: How to "move" style of parent to a child?
The trigger for this was a quick experiment to solve TreeItem selection width: the requirement is to highlight only the text, not the whole tree cell. Nothing easier than that (said Frederik :)
implement a custom TreeCell with a Label as graphic…

kleopatra
- 51,061
- 28
- 99
- 211
2
votes
1 answer
TreeView expanding/collapsing strange behaviour
I modeled a TreeView such that the nodes that have children, have a Folder icon as graphic, and the other ones have a playlist icon. The styles almost works, but when expanding/collapsing nodes, the graphic icons get broken.
When a node is…

transgressoft
- 155
- 2
- 13
2
votes
0 answers
JavaFX add Mouse Listener to TreeCell Graphic
I'm trying to add a MouseClicked event listener to a Tree Cell so that It fires when a user clicks on either the Graphic or the String value of the cell.
TestApp.java
public class TestApp extends Application {
@Override
public void…

Steve
- 981
- 1
- 8
- 22
2
votes
1 answer
JavaFX TreeTableView custom TreeCell with controls
I'm new to JavaFX 8 and tried to implement a TreeTableView with some jfxtras controls in my second and third column. Therefore I set up the cell factories of those columns with custom TreeCells e.g. like this:
col3.setCellFactory(new…

clic
- 365
- 1
- 13
2
votes
2 answers
JavaFx TreeCell how to expand nodes after one second
i'm implementing the Drag&Drop on a generic TreeView.
My purpose is to expand a folder during DragEntered event after a second of stationing, actual code:
setOnDragEntered(e -> {
TreeItem enteredItem = getSourceItem(e);
…

Alessandro
- 282
- 3
- 10
1
vote
0 answers
JavaFX Getting TreeView's prefWidth
I've been trying to determine a TreeView's preferred width but all I get when I call getPrefWidth() is -1. Is there a reason for that? For me the preferred width would be the width of the widest cell. That value must be stored somewhere since…

DeLoreanDriver
- 205
- 1
- 10
1
vote
1 answer
JavaFX: How to highlight certain Items in a TreeView
I am trying to implement a search function for a TreeView in JavaFX. I want to highlight all the matches when the user hits the enter key. So I added a boolean isHighlighted to my TreeItem and in my TreeCells updateItem, I check whether the item…

spilot
- 625
- 1
- 7
- 20
1
vote
2 answers
Get a list of all TreeCell objects that currently exist in a TreeView
I know that TreeCell objects are generated dynamically by the TreeView using a cell factory.
Is there a way to get a list of all TreeCell objects that currently exist?
I suppose I could keep track of them by modifying the cell factory. As in,…

Saturn
- 17,888
- 49
- 145
- 271
1
vote
1 answer
JavaFX 8 TreeView displays incorrect String when cell is clicked to edit
I'm using the following code from Oracle:
import java.util.Arrays;
import java.util.List;
import javafx.application.Application;
import javafx.event.Event;
import javafx.event.EventHandler;
import javafx.scene.Node;
import javafx.scene.Scene;
import…

SFX
- 169
- 11
0
votes
0 answers
TreeCell Line Bindings messing up at scroll
I have two TreeViews in my JavaFX GUI, which I fill dynamically. They can have a lot of data, so most of the time, they will be scrollable.
Afterwards, I create connections (or rather edges) between the TreeCells of both TreeViews. I draw a Line…

Ibi
- 31
- 2
0
votes
0 answers
Style TreeItem at the time of creation
I would like to have some of my TreeItems with different font, italic or color and I see that perhaps TreeCell in JavaFX should be used somehow.
I want to apply this at the moment I create the TreeItem, i.e. when I do
root.getChilden().add(...)
I…

Chavi
- 31
- 1
- 4
0
votes
0 answers
How do i set the grapic for a TextFieldTreeCell
I made a treeview with normal treecells and a cellfactory to display my custom objects.
I wanned to be able to edit the object names in the treeview.
So i switched from a normal TreeCell to a TextFieldTreeCell so that i can edit the name of my…

BetaBen
- 83
- 9
0
votes
1 answer
JavaFX TreeView tooltip conflicts with TreeCell tooltip
when searching the web I couldn't find any hint how to solve the following problem: I have a JavaFX Pane containing a TreeView. In the very beginning this TreeView is empty, therefore I added a Tooltip in the fxml file, which suggests the user to…

Alex
- 1,387
- 2
- 9
- 14
0
votes
1 answer
JavaFX TreeView adding item to the treeview results the same behavior of the two cells
I am willing to parse an XML Schema Definition and get the TreeView from the parsed file , then adding and removing items from the TreeView before generating an XML .
My issue is when i want to add a TreeItem from a selected one -duplicating it-…

Bilel Nebli
- 3
- 1
0
votes
1 answer
Change tree-cell selected font color in JavaFX
I have a JavaFX TreeView and want to change the font color of a selected cell to black, to make it look like a non-selected cell. (I tried setSelectionModel(null) but this throws errors.) The cells have a transparent background on a background…

A Noob
- 3
- 2