0

I am using JavaFx-2 and I am trying to modify my scrollbars in tableview. I want them to appear inside table without creating any extra space next to table. But they create a place by shrinking table (which means table's content gets smaller) and I can't make it disappear. Please help.

Here is my css,

.table-view .scroll-bar:horizontal {
-fx-opacity: 0.75;
-fx-background-color: #353535;
-fx-border-color: #333333;
-fx-pref-height: 25px;  
-fx-translate-y: 25px;  
}
.table-view .scroll-bar:vertical {
-fx-opacity: 0.75;
-fx-background-color: #353535;
-fx-border-color: #333333;
-fx-pref-width: 25px;   
-fx-translate-x: 25px;
}
.table-view .scroll-bar:horizontal .thumb,
.table-view .scroll-bar:vertical .thumb{
-fx-background-color: white ;
-fx-border-color: #333333;
}

I add images to comments, I can't post image here and I can't give link more than 2 because of the reputation.

Secil
  • 1
  • 3
  • You better create a fiddle/codepen to give us more context because we have no clue about the DOM of your page. – sjahan Sep 27 '17 at 11:32
  • My bad, I didn't know about CSS without HTML... :/ I thought this was 'classic' CSS issue, but looks like I cannot help on java fx ! – sjahan Sep 27 '17 at 11:36
  • It's not clear (not to me, anyway) what you're trying to do. The way layout works is that the `TableView` is assigned some bounds and asked to lay itself out within those bounds. If it determines it needs a vertical scroll bar, the scroll bar must appear within those bounds (it is part of the table view) and there is necessarily less space available for the table content. Maybe post a screenshot showing what you are getting and explain how it is different to what you want. – James_D Sep 27 '17 at 11:51
  • As an example, What I want to do: [link](https://i.hizliresim.com/V3LpBZ.png) But it looks like: [link](https://i.hizliresim.com/nJgPNV.png) And when I stop scrolling it looks like: [link](https://i.hizliresim.com/vJLzNz.png) PS: I don't want scrollbar always, assume I have longer list. – Secil Sep 27 '17 at 12:14
  • could be a problem in the code you are not showing - so please provide a code example that demonstrates it (see also: https://stackoverflow.com/help/how-to-ask) – kleopatra Sep 27 '17 at 13:33

0 Answers0