1   package org.wcb.gui.table;
2   
3   import javax.swing.*;
4   
5   /**
6    * <small>
7    * <p>
8    * Copyright (c)  2006  wbogaardt.
9    * This library is free software; you can redistribute it and/or
10   * modify it under the terms of the GNU Lesser General Public
11   * License as published by the Free Software Foundation; either
12   * version 2.1 of the License, or (at your option) any later version.
13   *
14   * This library is distributed in the hope that it will be useful,
15   * but WITHOUT ANY WARRANTY; without even the implied warranty of
16   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17   * Lesser General Public License for more details.
18   *
19   * You should have received a copy of the GNU Lesser General Public
20   * License along with this library; if not, write to the Free Software
21   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
22   * <p/>
23   * $File:  $ <br>
24   * $Change:  $ submitted by $Author: wbogaardt $ at $DateTime: Sep 19, 2006 11:37:37 AM $ <br>
25   * </small>
26   *
27   * @author wbogaardt
28   *         May not be needed.
29   */
30  
31  public class LogbookTable extends JTable {
32  
33      public LogbookTable() {
34          super();
35          showHorizontalScroll(true);
36      }
37  
38      /**this method shows the horizontal scroll bar when required.
39       *make sure it is called for other methods like setHeaderWidth etc to work properly
40       * Its being called in the two constructors provided here
41       */
42      public void showHorizontalScroll(boolean show){
43          if (show){
44              setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
45          }
46          else{
47              setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);
48          }
49      }
50  }