B4J Question tableview selectedrow question

boten

Active Member
Licensed User
Longtime User
ok, I can select a row in a tableview & scroll to it,
but it is not highlighted with the same hues (lightblue) as per clicking a row.
How to make the selected row stand up in the crowd in blue (and not in grey)
 
When a row is selected via
Code: Copy
tv1.ScrollTo(j)
tv1.SelectedRow=j
the selected row has grey background

adding :

Code: Copy
tv1.requestfocus
paints it blue, like a clicked row

my question: what css need i supply so that a selected row BUT NOT focused will have another color, not grey

tried using:
Code: Copy
.table-row-cell:filled:selected {
  -fx-background-color: pink;
}

but that just replaced the blue with pink regardless if the tableview was clicked or just row-selected (without request focus)
 
Upvote 0
The solution described in the link you provided changes the background for selected row REGARDLESS if the tableview is focused or not.

the CSS below will have 2 color for selected rows: 1st for selected AND focused; 2nd for selected BUT NOT focused.

Code: Copy
.table-row-cell:selected {
   -fx-selection-bar: #0093ff;         ' <---------------- the "default" blueish hue for selected & focused 
   -fx-selection-bar-non-focused: #C0FFC0;    '<---------- color for selected BUT NOT focused line
}
 
Upvote 0
Back
Top