jdk/src/share/demo/jfc/TableExample/README.txt
author tbell
Fri, 27 Feb 2009 10:54:11 -0800
changeset 2091 7faffd237305
parent 2 90ce3da70b43
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
The four examples in this directory show how to use some of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
features of the JTable component.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
TableExample:
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
   This application includes a GUI for configuring the
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
   database connection and specifying the query.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
TableExample2:
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
   The query and database connection are specified at the command
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
   line.  The results are displayed in a JTable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
TableExample3:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
   Is a minimal example showing how to plug a generic sorter into the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
   JTable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
TableExample4:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
   Uses specialized renderers and editors.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
TableExample3 and TableExample4 do not depend on database connectivity
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
and can be compiled and run in the normal way.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
The most interesting example is probably TableExample, which has a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
TextArea that can be used as an editor for an SQL expression.  Pressing
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
the Fetch button sends the expression to the database.  The results are
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
displayed in the JTable underneath the text area.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
To run TableExample and TableExample2, you need to find a driver for
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
your database and set the environment variable JDBCHOME to a directory
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
where the driver is installed.  See the following URL for a list of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
JDBC drivers provided by third party vendors:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
  http://java.sun.com/products/jdbc/drivers.html
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
Once you find the driver, you can run one of the database examples by
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
specifying a class path that includes the JDBC classes and the example
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
classes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
For example:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
  java -classpath $(JDBCHOME):TableExample.jar TableExample
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
These instructions assume that this installation's version of the java
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
command is in your path.  If it isn't, then you should either
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
specify the complete path to the java command or update your
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
PATH environment variable as described in the installation
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
instructions for the Java(TM) SE Development Kit.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44