01: /*
02: * DefaultTable.java
03: *
04: * Created on 15 July 2006, 23:01
05: *
06: * To change this template, choose Tools | Template Manager
07: * and open the template in the editor.
08: */
09:
10: package org.executequery.gui;
11:
12: import javax.swing.JTable;
13: import javax.swing.table.TableModel;
14: import org.underworldlabs.swing.plaf.UIUtils;
15: import org.underworldlabs.swing.table.DefaultTableHeaderRenderer;
16:
17: /**
18: * Default table display using a custom header renderer.
19: *
20: * @author Takis Diakoumis
21: * @version $Revision: 1.1 $
22: * @date $Date: 2006/07/15 13:14:49 $
23: */
24: public class DefaultTable extends JTable {
25:
26: /** Creates a new instance of DefaultTable */
27: public DefaultTable() {
28: this (null);
29: }
30:
31: /** Creates a new instance of DefaultTable */
32: public DefaultTable(TableModel model) {
33: super (model);
34: init();
35: }
36:
37: public DefaultTable(Object[][] rowData, Object[] columnNames) {
38: super (rowData, columnNames);
39: init();
40: }
41:
42: private void init() {
43: if (UIUtils.isDefaultLookAndFeel() || UIUtils.usingOcean()) {
44: getTableHeader().setDefaultRenderer(
45: new DefaultTableHeaderRenderer());
46: }
47: }
48:
49: }
|