All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jumbo.xml.gui.XTable

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----com.sun.java.swing.JComponent
                           |
                           +----com.sun.java.swing.JTable
                                   |
                                   +----jumbo.xml.gui.XTable

public class XTable
extends JTable
a simple subset of JTable, using defaults. getDisplayComponent() returns a Component for embedding elsewhere if required and takes care of JTableHeader (I hope)


Constructor Index

 o XTable(String, Object[][], String[])
make the table from already constructed Object arrays [rows][cols] and column names [cols]

Method Index

 o addComboBoxEditor(String, String[])
add ComboBox editing to a column - see SwingSet example
 o addComponent(String)
add Component to a cell - see SwingSet example
 o addRow(Object[])
add a row at end
 o display()
a default display in a JFrame
 o getCell(int, int)
get Cell as an object (silly value of iRow, jCol returns null)
 o getDisplayComponent()
returns a JPanel with a scrolling Table (still experimental)
 o getJFrame()
 o getName()
get the name of the table
 o getRow(int)
get Row as a Vector of objects (silly value of iRow returns null)
 o getRowCount()
get information
 o main(String[])
test routine
 o removeRow(int)
delete a row

Constructors

 o XTable
 public XTable(String name,
               Object inData[][],
               String columnNames[])
make the table from already constructed Object arrays [rows][cols] and column names [cols]

Parameters:
name - name of the table
inData - a [row][column] array of Objects
columnNames - a [column] vector of Strings
Throws: IllegalArgumentException
lengths of arrays are inconsistent

Methods

 o addComponent
 public void addComponent(String columnName)
add Component to a cell - see SwingSet example

 o addComboBoxEditor
 public void addComboBoxEditor(String columnName,
                               String values[])
add ComboBox editing to a column - see SwingSet example

 o getName
 public String getName()
get the name of the table

Returns:
String name the name of the table
Overrides:
getName in class Component
 o removeRow
 public void removeRow(int i)
delete a row

 o addRow
 public void addRow(Object row[])
add a row at end

 o getRowCount
 public int getRowCount()
get information

Overrides:
getRowCount in class JTable
 o getRow
 public Vector getRow(int iRow)
get Row as a Vector of objects (silly value of iRow returns null)

 o getCell
 public Object getCell(int iRow,
                       int jCol)
get Cell as an object (silly value of iRow, jCol returns null)

 o getDisplayComponent
 public JPanel getDisplayComponent()
returns a JPanel with a scrolling Table (still experimental)

Returns:
JPanel JPanel containing a JScrollPane
 o display
 public void display()
a default display in a JFrame

 o getJFrame
 public JFrame getJFrame()
 o main
 public static void main(String args[])
test routine


All Packages  Class Hierarchy  This Package  Previous  Next  Index