Here you can find the source of addHorizontalScrollBar(JTable table, JScrollPane pane)
public static void addHorizontalScrollBar(JTable table, JScrollPane pane)
//package com.java2s; /*/* www . j a v a 2 s.c o m*/ * codjo.net * * Common Apache License 2.0 */ import javax.swing.JScrollBar; import javax.swing.JScrollPane; import javax.swing.JTable; public class Main { /** * Force l'ajout d'une scrollbar horizontale sur une JTable. */ public static void addHorizontalScrollBar(JTable table, JScrollPane pane) { table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); pane.setHorizontalScrollBar(new JScrollBar(JScrollBar.HORIZONTAL)); table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); } }