Remove JavaFx Spinner Arrows - javafx

I want remove the arrows of a JavaFX Spinner.
I read how to remove the arrows of MenuButton in this link using CSS...but can't figure out how to do in my case .
remove arrows from menubutton
Any idea how ..thanks .

If you want to hide the array shapes you could do the same as the post you mentioned. The CSS properties you are looking for are :
.spinner .increment-arrow-button .increment-arrow {
-fx-padding: 0;
}
.spinner .decrement-arrow-button .decrement-arrow {
-fx-padding: 0;
}
If you don't want to alter their size by changing the padding you could set Shape to something non visible or just change it's background color to -fx-background-color: transparent;

Related

Javafx TableView tabelmenubutton CSS Stylesheet

By setting setTableMenuButtonVisible(true) on my tableview, I am able to see a button with a "+" sign on the top right corner, where u can select to show/hide columns. I wish to use a stylesheet to change the background color as well as the label colours etc but nothing works. I've tried the following:
.button
.toggle-button,
.menu-button {
-fx-background-color: black;
}
As always when it is about JavaFX styling, I recommand to use the Oracle documentation in order to see what compose the control (in your case the TableView and to search the default styling for each element in Modena.css (the default styling sheet since JavaFx 8).
Knowing that it is easy to style the table menu button :
/**
* For styling only the "+" button on the right top corner
*/
.table-view > .column-header-background > .show-hide-columns-button {
-fx-background-color: black;
}
/**
* In order to style any other column header's background
*/
.table-view .column-header {
-fx-background-color : yellow;
}
/**
* For styling column header's labels
*/
.table-view .column-header .label {
-fx-text-fill : green;
}

How to correctly override default JavaFX 8 CSS on TableView

I am attempting to override the default style of certain columns in a tableview in JavaFX. Basically I would like to have editable values present a lightyellow background so that people know that those columns are editable.
However when I set this CSS on the field:
.editableColumn.table-cell {
-fx-background-color:lightyellow;
-fx-alignment:CENTER-RIGHT;
-fx-border-width: .5px;
-fx-border-style: solid;
-fx-border-color:grey;
}
It removed the rest of the formatting, so highlight bars, etc are gone.
What CSS properties do I need to set so that the highlighting works, so that my values don't vanish (here it's white on yellow so you can't see the value).
Thanks!
If you just want to make sure the text color is appropriate for the background you set, try setting -fx-background to the same value as -fx-background-color:
.editableColumn.table-cell {
-fx-background-color:lightyellow;
-fx-background: lightyellow ;
-fx-alignment:CENTER-RIGHT;
-fx-border-width: .5px;
-fx-border-style: solid;
-fx-border-color:grey;
}
If you want the "selected style" to override the "editable style" for cells that are both in your column and are in a selected row, I think you will need to manually revert to the default styles for selected cells. Something like
.table-row-cell:filled:selected .editableColumn.table-cell {
-fx-background-color: null ;
-fx-border-color: transparent -fx-table-cell-border-color transparent transparent;
/* -fx-border-width: null ; (not sure about this one...) */
}

ScrollPanes in JavaFX 8 always have gray background

When I upgraded by JavaFX app from JavaFX 2 to JavaFX 8, I noticed that ScrollPanes always showed up as gray rectangles, even with a background color set or the background set to be transparent.
I found the solution in this discussion: https://community.oracle.com/thread/3538169
First I needed this:
.scroll-pane > .viewport {
-fx-background-color: transparent;
}
Then I could set the background color to whatever I like. In this case, I'm making all ScrollPane backgrounds transparent:
.scroll-pane {
-fx-background-color: transparent;
}
Came acroos this just now, it's not working with -fx-background-color, but it is with -fx-background
.scroll-pane {
-fx-background: #FFFFFF;
-fx-border-color: #FFFFFF;
}
To alter borders, you would have to use "fx-background-color" .
To modify the viewport's background color, you should modify the "fx-background" attribute.
I used white for both colors :
scrollPane.setStyle("-fx-background: rgb(255,255,255);\n -fx-background-color: rgb(255,255,255)");
In-source approach:
Once it's added to the scene/stage, you can trigger off the width or height property to get access to the viewport styling.
ScrollPane myPane = new ScrollPane();
myPane.widthProperty().addListener((o) -> {
Node vp = logMessagePane.lookup(".viewport");
vp.setStyle("-fx-background-color:#434547;");
});

How to change the color of Kendo Grid elements

Is it possible to change the grid color element in Kendo UI?
I have changed the color of the text, without a problem:
.k-grid th.k-header,
.k-grid th.k-header .k-link
{
color:white;
}
How to change the color of the arrow?
The arrow is a png so you have to create your own image and then select it as:
#grid .k-icon.k-i-arrow-n {
background-image: url('path to the image');
background-position: 0 0;
}
You might try playing with CSS transformation and see if you can get the color that you want but that uses to be very easy if they were defined as fonts.

disabling JavaFX TableView's vertical scrollbar

I'd like to disable vertical scrollbar in a tableview to not be shown when there are too many items in it.
If it's posibble than my next question is: can i still scroll this table? For example bind scrolling to two buttons - up and down....
Apparently using css:
.table-view .scroll-bar:vertical > .increment-button,
.table-view .scroll-bar:vertical > .decrement-button {
-fx-background-color: null;
-fx-background-radius: 0;
-fx-background-insets: 0;
-fx-padding: 0;
}
can help a little as the table still shows a scrollbar(though a very small one)

Resources