Javafx combobox styling - javafx-2

I need a combobox in javaFX whose popup behavior can be controlled, like upon clicking the combobox, instead of default behavior where it shows a drop down, i want the drop down to be shown above the combobox (insetad of display below the combobox) .
Is it possible ?
Can we do this with css ?
Thanks for any help.

I hope this will work for you. Make some changes according your need
.combo-box .list-cell
{
-fx-background: white;
-fx-background-color: transparent;
-fx-text-fill: -fx-text-base-color;
-fx-padding: 3 0 2 7;
-fx-cell-size: 1.66667em;
}
.combo-box-popup .list-view
{
-fx-background-color: white, white;
-fx-background-insets: 0, 1;
-fx-effect: dropshadow( three-pass-box , rgba(0,0,0,0.6) , 8, 0.0 , 0 , 0 );
}
.combo-box-popup .list-view .list-cell
{
-fx-padding: 4 0 4 5;
/* No alternate highlighting */
-fx-background-color: white;
}
.combo-box-popup .list-view .list-cell:filled:selected, .combo-box-popup .list-view .list-cell:filled:selected:hover
{
-fx-background: -fx-accent;
-fx-background-color: -fx-selection-bar;
-fx-text-fill: -fx-selection-bar-text;
}
.combo-box-popup .list-view .list-cell:filled:hover
{
-fx-background-color: white;
-fx-text-fill: -fx-text-inner-color;
}
.combo-box-base
{
-fx-skin: "com.sun.javafx.scene.control.skin.ComboBoxBaseSkin";
-fx-background-color: white, white, white, white;
-fx-background-radius: 5, 5, 4, 3;
-fx-background-insets: 0 0 -1 0, 0, 1, 2;
-fx-padding: 0;
}
.combo-box-base:hover
{
-fx-color: -fx-hover-base;
}
.combo-box-base:showing
{
-fx-color: -fx-pressed-base;
}
.combo-box-base:focused {
-fx-background-color: -fx-focus-color, -fx-outer-border, -fx-inner-border, -fx-body-color;
-fx-background-radius: 6.4, 4, 5, 3;
-fx-background-insets: -1.4, 0, 1, 2;
}
.combo-box-base:disabled {
-fx-opacity: .4;
}

Related

How to absolutely ensure Direct3D9 hook overlay rendering on top

I'm trying to hook IDirect3DDevice9::Present or ::EndScene and render my own overlay (which, for now, is just a simple rectangle) on top of everything else in a D3D9 application, but my overlay seems to be appearing and disappearing quite randomly. The drawing code I'm currently using is:
typedef struct CUSTOMVERTEX {
float x, y, z, rwh;
DWORD color;
};
#define CUSTOMFVF (D3DFVF_XYZRHW | D3DFVF_DIFFUSE)
void draw() {
// the positions are just for testing purposes, so they don't really make sense
CUSTOMVERTEX vertices[] = {
{ 0, 0, 0, 1.0f, D3DCOLOR_XRGB(255, 255, 255) },
{ 0, cursor_pos.y+500, 0, 1.0f, D3DCOLOR_XRGB(127, 255, 255) },
{ cursor_pos.x, cursor_pos.y, 0, 1.0f, D3DCOLOR_XRGB(255,255, 255) },
{ cursor_pos.x, 600, 0, 1.0f, D3DCOLOR_XRGB(127, 0, 0) }
};
if (vBuffer == 0) return;
VOID* pVoid;
vBuffer->Lock(0, 0, &pVoid, 0);
memcpy(pVoid, vertices, sizeof(vertices));
vBuffer->Unlock();
d3dDevice->SetRenderState(D3DRS_LIGHTING, FALSE);
d3dDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE);
D3DMATRIX orthographicMatrix;
D3DMATRIX identityMatrix;
// MAKE_D3DMATRIX should be equivalent to D3DXMATRIX constructor
D3DMATRIX viewMatrix = MAKE_D3DMATRIX(
1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
((float)-(get_window_width()/2)), ((float)-(get_window_height()/ 2)), 0, 1
);
// MAKE_ORTHO_LH is equivalent to D3DMatrixOrthoLH
MAKE_ORTHO_LH(&orthographicMatrix, (FLOAT)get_window_width(), (FLOAT)get_window_height(), -1.0, 1.0);
// and this to D3DMatrixIdentity
MAKE_IDENTITY(&identityMatrix); // and this to D3DMatrixIdentity
d3dDevice->SetTransform(D3DTS_PROJECTION, &orthographicMatrix);
d3dDevice->SetTransform(D3DTS_WORLD, &identityMatrix);
d3dDevice->SetTransform(D3DTS_VIEW, &viewMatrix);
d3dDevice->SetRenderState(D3DRS_ZENABLE, false);
d3dDevice->SetFVF(CUSTOMFVF);
d3dDevice->SetStreamSource(0, vBuffer, 0, sizeof(CUSTOMVERTEX));
d3dDevice->DrawPrimitive(D3DPT_TRIANGLEFAN, 0, 2);
d3dDevice->SetRenderState(D3DRS_ZENABLE, true);
}
I can't seem to figure out why this would cause the overlay to pop in and out of existence at seemingly random points in time.. What am I missing?
I found a foolproof method to render my stuff directly to the backbuffer (on CPU):
IDirect3DSwapChain9 *sc;
if (FAILED(d3dDevice->GetSwapChain(0, &sc))) {
PRINT("GetSwapChain failed\n");
return;
}
IDirect3DSurface9 *s;
if (FAILED(sc->GetBackBuffer(0, D3DBACKBUFFER_TYPE_MONO, &s))) {
PRINT("GetBackBuffer failed\n");
return;
}
D3DLOCKED_RECT r;
if (FAILED(s->LockRect(&r, NULL, D3DLOCK_DONOTWAIT))) {
PRINT("LockRect failed\n");
return;
}
// here, find out pixel format and manipulate
// pixel buffer through r->pBits, using r->Pitch accordingly
s->UnlockRect();
s->Release();
sc->Release();
Will most probably incur a performance penalty, but in my application this doesn't really make a difference. A more optimal way would be to harness the GPU's hwacceled rendering capabilities, but I currently lack the D3D knowledge to do so.

set background color in scrollpane

I have set background color in scrollpane using setStyle() method. the below code is working fine in up to "jdk-8-ea-bin-b109" java version after that java versions, these commend is not working properly but while mouse over the color has been applying.
My code is:
scrlPane.setStyle("-fx-background-color:#434547;");
From a question I created in regards to ScrollPane background colors in JavaFX 8:
ScrollPanes in JavaFX 8 always have gray background
You may need to use this CSS so that ScrollPane styling can actually work:
.scroll-pane > .viewport {
-fx-background-color: transparent;
}
try this it change scroll pane color
.scroll-bar:horizontal .thumb {
-fx-background-color:
red,
linear-gradient(to bottom, derive(red,95%), derive(red,10%)),
linear-gradient(to bottom, derive(red,38%), derive(red,-16%));
-fx-background-insets: 0, 1, 2;
-fx-background-radius: 0.5em; /* makes sure this remains circular */
}
.scroll-bar:vertical .thumb {
-fx-background-color:
red,
linear-gradient(to right, derive(red,95%), derive(red,10%)),
linear-gradient(to right, derive(red,38%), derive(red,-16%));
-fx-background-insets: 0, 1, 2;
-fx-background-radius: 0.5em; /* makes sure this remains circular */
}
it shows like below
here the global css for scroll pane for further changes;
.scroll-bar:horizontal {
-fx-background-color:
red,
linear-gradient(to bottom, derive(red,30%) 5%, derive(red,-17%) 100%);
-fx-background-insets: 0, 1;
}
.scroll-bar:horizontal:focused {
-fx-background-color:
-fx-focus-color,
-fx-box-border,
linear-gradient(to bottom, derive(red,30%) 5%, derive(red,-17%) 100%);
-fx-background-insets: -1.4, 0, 1;
}
.scroll-bar:vertical {
-fx-background-color:
red,
linear-gradient(to top, derive(red,30%) 5%, derive(red,-17%) 100%);
-fx-background-insets: 0, 1;
}
.scroll-bar:vertical:focused {
-fx-background-color:
red,
red,
linear-gradient(to top, derive(red,30%) 5%, derive(red,-17%) 100%);
-fx-background-insets: -1.4, 0, 1;
}
.scroll-bar:horizontal .thumb {
-fx-background-color:
red,
linear-gradient(to bottom, derive(red,95%), derive(red,10%)),
linear-gradient(to bottom, derive(red,38%), derive(red,-16%));
-fx-background-insets: 0, 1, 2;
-fx-background-radius: 0.5em; /* makes sure this remains circular */
}
.scroll-bar:vertical .thumb {
-fx-background-color:
red,
linear-gradient(to right, derive(red,95%), derive(red,10%)),
linear-gradient(to right, derive(red,38%), derive(red,-16%));
-fx-background-insets: 0, 1, 2;
-fx-background-radius: 0.5em; /* makes sure this remains circular */
}
.scroll-bar:focused .thumb {
-fx-color: -fx-focused-base;
}
.scroll-bar .thumb:hover {
-fx-color: -fx-hover-base;
}
/* Uncomment when RT-10521 is fixed.
.scroll-bar .thumb:pressed {
-fx-color: -fx-pressed-base;
}
*/
.scroll-bar:horizontal .track {
-fx-background-color:
-fx-box-border,
linear-gradient(to bottom, derive(-fx-color,-15%), derive(-fx-color,2.2%) 20%, derive(-fx-color,60%));
-fx-background-insets: 0, 1;
-fx-background-radius: 0.5em; /* makes sure this remains circular */
}
.scroll-bar:horizontal .track-background {
-fx-background-color:
-fx-box-border,
linear-gradient(to bottom, derive(-fx-color,-15%), derive(-fx-color,2.2%) 20%, derive(-fx-color,60%));
-fx-background-insets: 0, 1;
}
.scroll-bar:vertical .track {
-fx-background-color:
-fx-box-border,
linear-gradient(to right, derive(-fx-color,-15%), derive(-fx-color,2.2%) 20%, derive(-fx-color,60%));
-fx-background-insets: 0, 1;
-fx-background-radius: 0.5em; /* makes sure this remains circular */
}
.scroll-bar:vertical .track-background {
-fx-background-color:
-fx-box-border,
linear-gradient(to right, derive(-fx-color,-15%), derive(-fx-color,2.2%) 20%, derive(-fx-color,60%));
-fx-background-insets: 0, 1;
}
.scroll-bar .increment-button {
-fx-background-color:
-fx-box-border,
linear-gradient(to bottom, derive(-fx-color,30%) 5%, derive(-fx-color,-17%));
-fx-background-insets: 0, 1;
-fx-padding: 0.25em; /* 3 */
}
.scroll-bar .decrement-button {
-fx-background-color:
-fx-box-border,
linear-gradient(to bottom, derive(-fx-color,30%) 5%, derive(-fx-color,-17%));
-fx-background-insets: 0, 1;
-fx-padding: 0.25em; /* 3 */
}
.scroll-bar:horizontal .increment-arrow {
-fx-background-color: -fx-mark-highlight-color, -fx-mark-color;
-fx-background-insets: 1 0 -1 0, 0;
-fx-padding: 0.5em 0.333333em 0.0em 0.0em; /* 6 4 0 0 */
-fx-shape: "M 4 0 L 0 -3 L 0 3 z";
}
.scroll-bar:vertical .increment-arrow {
-fx-background-color: -fx-mark-highlight-color, -fx-mark-color;
-fx-background-insets: 1 0 -1 0, 0;
-fx-padding: 0.333333em 0.5em 0.0em 0.0em; /* 4 6 0 0 */
-fx-shape: "M -3 0 L 0 4 L 3 0 z";
}
.scroll-bar:horizontal .decrement-arrow {
-fx-background-color: -fx-mark-highlight-color, -fx-mark-color;
-fx-background-insets: 1 0 -1 0, 0;
-fx-padding: 0.5em 0.333333em 0.0em 0.0em; /* 6 4 0 0 */
-fx-shape: "M 0 0 L 4 -3 L 4 3 z";
}
.scroll-bar:vertical .decrement-arrow {
-fx-background-color: -fx-mark-highlight-color, -fx-mark-color;
-fx-background-insets: 1 0 -1 0, 0;
-fx-padding: 0.333333em 0.5em 0.0em 0.0em; /* 4 6 0 0 */
-fx-shape: "M -3 0 L 0 -4 L 3 0 z";
}
.scroll-bar:disabled {
-fx-opacity: -fx-disabled-opacity;
}

How can we set a particular color for selected item on ListView in java fx? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
How can we set a particular color for selected item on ListView in java fx?
Thanks in advance!!!
Add appropriate rules to your css file to override the following rules (copied from caspian.css):
.list-cell {
-fx-skin: "com.sun.javafx.scene.control.skin.ListCellSkin";
-fx-background-color: -fx-control-inner-background;
-fx-padding: 0.25em; /* 3 */
-fx-text-fill: -fx-text-inner-color;
-fx-opacity: 1;
}
.list-cell:odd {
-fx-background-color: derive(-fx-control-inner-background,-5%);
}
.list-view:focused .list-cell:focused {
-fx-background-color: -fx-focus-color, -fx-cell-focus-inner-border, -fx-control-inner-background;
-fx-background-insets: 0, 1, 2;
}
.list-view:focused .list-cell:focused:odd {
-fx-background-color: -fx-focus-color, -fx-cell-focus-inner-border, derive(-fx-control-inner-background,-5%);
-fx-background-insets: 0, 1, 2;
}
/* When the list-cell is selected and focused */
.list-view:focused .list-cell:filled:focused:selected {
-fx-background-color: -fx-focus-color, -fx-cell-focus-inner-border, -fx-selection-bar;
-fx-background-insets: 0, 1, 2;
-fx-background: -fx-accent;
-fx-text-fill: -fx-selection-bar-text;
}
.list-view:focused .list-cell:filled:selected, .list-view:focused .list-cell:filled:selected:hover {
-fx-background: -fx-accent;
-fx-background-color: -fx-selection-bar;
-fx-text-fill: -fx-selection-bar-text;
}
.list-view:focused .list-cell:filled:focused:selected:hover {
-fx-background: -fx-accent;
-fx-background-color: -fx-focus-color, -fx-cell-focus-inner-border, -fx-selection-bar;
-fx-background-insets: 0, 1, 2;
-fx-text-fill: -fx-selection-bar-text;
}
/* When the ListView is _not_ focused, we show alternate selection colors */
.list-cell:filled:selected:focused, .list-cell:filled:selected, .list-view:horizontal .list-cell:filled:selected {
-fx-background-color: lightgray;
-fx-text-fill: -fx-selection-bar-text;
}
.list-cell:filled:selected:focused:disabled, .list-cell:filled:selected:disabled {
-fx-opacity: -fx-disabled-opacity;
}
.list-cell:filled:hover {
-fx-background-color: -fx-cell-hover-color;
-fx-text-fill: -fx-text-inner-color;
}
.list-view:focused .list-cell:filled:focused:hover {
-fx-background-color: -fx-focus-color, -fx-cell-focus-inner-border, -fx-cell-hover-color;
-fx-background-insets: 0, 1, 2;
-fx-text-fill: -fx-text-inner-color;
}
.list-view:horizontal .list-cell:filled:selected, .list-view:horizontal .list-cell:filled:selected:hover {
-fx-background-color: linear-gradient(to right, derive(-fx-accent,-7%), derive(-fx-accent,-25%));
}
Especially, look for :selected pseudo classes and modify them as you need.

How to change the tab pane style

I use the default JavaFX tab pane layout
I want to display new tabs below the old ones. I don't want to display the default context menu to select which tab to display. Are there any options to change this?
try this....change it according your need.this is default css for tab pane and their layout... i used it and work sucessfully
.tab-pane
{
-fx-skin: "com.sun.javafx.scene.control.skin.TabPaneSkin";
/* -fx-tab-min-width: 4.583em; 55 */
/* -fx-tab-max-width: 4.583em; 55 */
-fx-tab-min-height: 2em; /* 24 */
-fx-tab-max-height: 2em; /* 24 */
}
.tab .tab-label
{
-fx-skin: "com.sun.javafx.scene.control.skin.LabelSkin";
-fx-background-color: transparent;
-fx-alignment: CENTER;
-fx-text-fill: -fx-text-base-color;
}
/*
.tab *.tab-label Text {
-fx-effect: dropshadow(two-pass-box , rgba(255, 255, 255, 0.4), 1, 0.0 , 0, 1);
}*/
.tab-content-area
{
-fx-background-color: -fx-control-inner-background;
-fx-padding: 0.0em; /* 0 */
/* -fx-opacity: -fx-disabled-opacity;*/
}
.tab
{
/* This is how it is done in Button, but the -1 inset caused a white line */
/* to appear beneath the tab, which looks bad, so it's taken out below. */
/* -fx-background-color: -fx-shadow-highlight-color, -fx-tab-border-color, -fx-inner-border, -fx-body-color;
-fx-background-radius: 5 5 0 0, 5 5 0 0, 4 4 0 0, 3 3 0 0;
-fx-background-insets: 0 0 -1 0, 0, 1, 2;*/
-fx-background-insets: 0, 1, 2;
-fx-background-radius: 5 5 0 0, 4 4 0 0, 3 3 0 0;
-fx-padding: 0.083333em 0.5em 0.083333em 0.5em; /* 1 6 1 6 */
/* -fx-text-fill: -fx-text-base-color;*/
}
.tab:top
{
-fx-background-color: -fx-tab-border-color, -fx-inner-border, -fx-body-color;
}
.tab:right
{
-fx-background-color: -fx-tab-border-color, -fx-inner-border-bottomup, -fx-body-color-bottomup;
}
.tab:bottom
{
-fx-background-color: -fx-tab-border-color, -fx-inner-border-bottomup, -fx-body-color-bottomup;
}
.tab:left
{
-fx-background-color: -fx-tab-border-color, -fx-inner-border, -fx-body-color;
}
.tab:hover
{
-fx-color: -fx-hover-base;
}
.tab:selected
{
/* -fx-background-color: white;*/
/* -fx-background-color: -fx-tab-border-color, -fx-inner-border, -fx-body-color;
-fx-background-radius: 5 5 0 0, 4 4 0 0, 3 3 0 0;
-fx-background-insets: 0, 1 1 0 1, 2 2 0 2;*/
-fx-background-color: -fx-tab-border-color, -fx-control-inner-background;
-fx-background-insets: 0, 1 1 0 1;
-fx-background-radius: 5 5 0 0, 4 4 0 0;
}
.tab:disabled
{
-fx-opacity: -fx-disabled-opacity;
}
.tab:disabled:hover
{
-fx-color: -fx-base;
-fx-opacity: -fx-disabled-opacity;
}
.tab-pane *.tab-header-background
{
-fx-background-color: -fx-outer-border, -fx-inner-border, derive(-fx-color, -20%);
-fx-effect: innershadow(two-pass-box , rgba(0,0,0,0.6) , 4, 0.0 , 0 , 0);
}
/*.tab-pane *.tab-header-area {*/
/* I would like to use -fx-tab-border-color here, but for some reason it */
/* just isn't the correct color, even though it works in :top above */
/* -fx-background-color: -fx-tab-border-color, lightgray;*/
/*}*/
.tab-pane:top *.tab-header-area
{
-fx-background-insets: 0, 0 0 1 0;
-fx-padding: 0.416667em 0.166667em 0.0em 0.833em; /* 5 2 0 10 */
}
.tab-pane:bottom *.tab-header-area
{
-fx-background-insets: 0, 1 0 0 0;
-fx-padding: 0 0.166667em 0.416667em 0.833em; /* 0 2 5 0 */
}
.tab-pane:left *.tab-header-area
{
-fx-background-insets: 0, 0 1 0 0;
-fx-padding: 0.833em 0.0em 0.166667em 0.416667em; /* 10 0 2 5 */
}
.tab-pane:right *.tab-header-area
{
-fx-background-insets: 0, 0 0 0 1;
-fx-padding: 0.833em 0.416667em 0.166667em 0.0em; /* 10 5 2 0 */
}
.tab-pane .headers-region
{
-fx-effect: dropshadow(two-pass-box , rgba(0,0,0,0.6) , 4, 0.0 , 0, 0);
}
/* TODO: scaling the shape seems to make it way too large */
.tab-close-button
{
-fx-background-color: -fx-mark-color;
-fx-shape: "M 0,0 H1 L 4,3 7,0 H8 V1 L 5,4 8,7 V8 H7 L 4,5 1,8 H0 V7 L 3,4 0,1 Z";
-fx-scale-shape: false;
-fx-effect: dropshadow(two-pass-box , rgba(255, 255, 255, 0.4), 1, 0.0 , 0, 1);
}
.tab-close-button:hover
{
-fx-background-color: derive(-fx-mark-color, -30%);
}
/* CONTROL BUTTONS */
.control-buttons-tab
{
-fx-background-color: -fx-tab-border-color, -fx-inner-border, -fx-body-color;
-fx-background-insets: 0, 1, 2;
-fx-background-radius: 5 5 0 0, 4 4 0 0, 3 3 0 0;
-fx-padding: 0.083333em 0.25em 0.083333em 0.25em; /* 1 3 1 3 */
}
.tab-down-button
{
-fx-background-color: transparent;
-fx-padding: 0.0em 0.416667em 0.0em 0.416667em; /* 0 5 0 5 */
}
.tab-down-button:hover
{
-fx-background-color: -fx-body-color;
-fx-color: -fx-hover-base;
}
.tab-down-button .arrow
{
-fx-background-color: -fx-mark-highlight-color, -fx-mark-color;
-fx-background-insets: 1 0 -1 0, 0;
-fx-padding: 0.238083em 0.416667em 0.238083em 0.416667em; /* 2.857 5 2.857 5 */
-fx-shape: "M 0 0 H 7 L 3.5 4 z";
}
/* FLOATING TABS CUSTOMISATION */
.tab-pane.floating *.tab-header-background {
-fx-background-color: null;
}
.tab-pane.floating *.tab-header-area
{
-fx-background-color: null;
}
.tab-pane.floating *.tab-content-area
{
-fx-background-color: -fx-tab-border-color, -fx-control-inner-background;
-fx-background-insets: 0, 1;
-fx-background-radius: 5, 4;
}
.tab-pane.floating *.tab
{
-fx-background-color: -fx-tab-border-color, -fx-inner-border, -fx-body-color;
-fx-background-insets: 0, 1, 2;
-fx-background-radius: 5 5 0 0, 4 4 0 0, 3 3 0 0;
}
.tab-pane.floating *.tab:selected
{
-fx-background-color: -fx-tab-border-color, -fx-control-inner-background;
-fx-background-insets: 0 0 -1 0, 1 1 -1 1;
-fx-background-radius: 5 5 0 0, 4 4 0 0;
}
/*.tab-pane:floating *.control-buttons-tab
{
-fx-padding: 0.083333em 0.25em 0.083333em 0.25em;
-fx-background-color: -fx-tab-border-color, -fx-inner-border, -fx-body-color;
-fx-background-radius: 5 5 0 0, 4 4 0 0, 3 3 0 0;
-fx-background-insets: 0, 1 1 0 1, 2 2 0 2;
}*/

How to change the colors of the TableView's rows?

I have a tableview and want to change the default colors of the rows if I...
1. ... hover above a row.
2. ... selected a row.
Is there a easy way to do all of it in the css-file?
All I found out is that for case 1, I can set
.table-cell:hover {
-fx-background-color: green; }
in the css-file. With that the color of the cell changes but not the color of the whole row.
.table-view .row-selection:hover{
-fx-background-color: lightgreen; }
and a lot of other combinations I tried are not working.
/* Selected row */
.table-view:focused .table-row-cell:filled:focused:selected {
-fx-background-color: brown;
-fx-background-insets: 0, 1, 2;
-fx-background: -fx-accent;
-fx-text-fill: -fx-selection-bar-text;
}
/* Selected row when table not focused */
.table-row-cell:filled:focused:selected {
-fx-background-color: red;
-fx-background-insets: 0, 1, 2;
-fx-background: -fx-accent;
-fx-text-fill: -fx-selection-bar-text;
}
/* Row hovered */
.table-view:row-selection .table-row-cell:filled:hover {
-fx-background-color: green;
-fx-background-insets: 0, 0 0 1 0;
-fx-text-fill: -fx-text-inner-color;
}
/* Selected row hovered */
.table-view:focused .table-row-cell:filled:focused:selected:hover {
-fx-background: -fx-accent;
-fx-background-color: yellow;
-fx-background-insets: 0, 1, 2;
-fx-text-fill: -fx-selection-bar-text;
}
/* Selected row hovered when table not focused */
.table-view:row-selection .table-row-cell:filled:focused:hover {
-fx-background-color: blue;
-fx-background-insets: 0, 0 0 1 0, 1 1 2 1, 2 2 3 2, 3 3 4 3;
-fx-text-fill: -fx-text-inner-color;
}

Resources