title: Completely Hiding or Disabling Horizontal Scrollbar in JavaFX TableView
body: <p>I realize there are other posts about this, but this is not a duplicate.</p>
  
  <p>If I use the following code to hide the horizontal scrollbar from a TableView, there still is 1 or 2 pixel area at the bottom of the table, from which the user can scroll the TableView horizontally --- with the mouse wheel (SHIFT+mouse wheel also works, from anywhere in the table area).</p>
  
  <pre><code>.table-view *.scroll-bar:horizontal *.increment-button,
  .table-view *.scroll-bar:horizontal *.decrement-button {
      -fx-background-color: null;
      -fx-background-radius: 0;
      -fx-background-insets: 0;
      -fx-padding: 0;
  }
  
  .table-view *.scroll-bar:horizontal *.increment-arrow,
  .table-view *.scroll-bar:horizontal *.decrement-arrow {
      -fx-background-color: null;
      -fx-background-radius: 0;
      -fx-background-insets: 0;
      -fx-padding: 0;
      -fx-shape: null;
  }
  </code></pre>
  
  <p>I tried some reflection hacks to access the scrollbar and attempt to disable it that way, with no success. Anyone have ideas?</p>
  
  <p>EDIT - here's a minimal example, for me it's always reproducible on Win 10, JavaFX 12.0.1.</p>
  
  <p>Test.java:</p>
  
  <pre><code>import javafx.application.Application;
  import javafx.collections.FXCollections;
  import javafx.collections.ObservableList;
  import javafx.scene.Scene;
  import javafx.scene.control.SelectionMode;
  import javafx.scene.control.TableColumn;
  import javafx.scene.control.TableView;
  import javafx.scene.layout.StackPane;
  import javafx.stage.Stage;
  
  /**
   * Horizontal scrolling via mouse wheel is possible when you place the cursor at the bottom of the window, just above the resize-area.
   */
  public class Test extends Application {
  
      @Override
      public void start(Stage primaryStage) {
          TableView&lt;String&gt; table = new TableView&lt;&gt;();
  
          table.getColumns().add(new TableColumn&lt;&gt;("first"));
          table.getColumns().add(new TableColumn&lt;&gt;("second"));
          table.getColumns().add(new TableColumn&lt;&gt;("third"));
          table.getColumns().add(new TableColumn&lt;&gt;("fourth"));
          table.getColumns().add(new TableColumn&lt;&gt;("fifth"));
          table.getColumns().add(new TableColumn&lt;&gt;("sixth"));
          table.getColumns().add(new TableColumn&lt;&gt;("seventh"));
          table.getColumns().add(new TableColumn&lt;&gt;("eighth"));
          table.getColumns().add(new TableColumn&lt;&gt;("ninth"));
          table.getColumns().add(new TableColumn&lt;&gt;("tenth"));
  
          table.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
  
  //        table.addEventFilter(ScrollEvent.ANY, Event::consume);
  
          ObservableList&lt;String&gt; data = FXCollections.observableArrayList();
          for (int i = 0; i &lt; 5000; i++) {
              data.add("foobar");
          }
          table.setItems(data);
  
          StackPane root = new StackPane();
          root.getChildren().add(table);
  
          Scene scene = new Scene(root, 300, 250);
  
          scene.getStylesheets().add("test.css");
  
          primaryStage.setTitle("Hello World!");
          primaryStage.setScene(scene);
          primaryStage.show();
      }
  
      public static void main(String[] args) {
          Application.launch(Test.class);
      }
  }
  </code></pre>
  
  <p>Test.CSS:</p>
  
  <pre><code>.table-view .scroll-bar * {
      -fx-min-width: 0;
      -fx-pref-width: 0;
      -fx-max-width: 0;
  
      -fx-min-height: 0;
      -fx-pref-height: 0;
      -fx-max-height: 0;
  }
  </code></pre>