home *** CD-ROM | disk | FTP | other *** search
/ Java 1.2 How-To / JavaHowTo.iso / 3rdParty / jbuilder / unsupported / JDK1.2beta3 / SOURCE / DEMO / JFC / TABLE / README.TXT < prev    next >
Encoding:
Text File  |  1998-03-20  |  1.7 KB  |  42 lines

  1. The four examples in this directory: TableExample1, TableExample2, 
  2. TableExample3 and TableExample4 show how to use some of the features 
  3. of swing's JTable component: 
  4.  
  5. 1. Using the JTable to show data from an SQL query input on the command line. 
  6. 2. As 1., but with a UI for configuring the database connection and query. 
  7. 3. A minmal example showing how to plug a generic sorter into the JTable. 
  8. 4. Some examples of using specialized renderers and editors. 
  9.  
  10. The second two demonstation programs: TableExample3 and TableExample4 
  11. do not depend on database connectivity and can be compiled and run 
  12. run in the normal way. 
  13.  
  14. The most interesting example is probably, TableExample2, which 
  15. has a TextArea which can be used as an editor for an SQL expression. 
  16. When the Fetch button is pressed the expression is sent to the database 
  17. and the results are displayed in the JTable underneath it.
  18.  
  19. To run TableExample1 and TableExample2, you'll need to find a driver for 
  20. your database and set the environment variable JDBCHOME to a directory
  21. where it is installed. The online documentation in:
  22. http://java.sun.com/products/jfc/swingdoc-current/index.html
  23. describes how to do this.  Having done this you can run one
  24. of the examples by specifying a classpath that includes the
  25. JDBC classes, the JDK classes and the example classes themselves.
  26. For example to run TableExample2:
  27.  
  28. On jdk1.2 on Solaris:
  29.   java -classpath $(JDBCHOME):/usr/local/java/lib/classes.zip TableExample2
  30.  
  31. On jdk1.1.x on Solaris:
  32.   setenv SWING_HOME <path to swing release>
  33.   setenv JAVA_HOME <path to jdk1.1.x release>
  34.   runnit 
  35.  
  36.  
  37. On jdk1.1.x on win32:
  38.   set CLASSPATH=<path to jdk1.1.x release>\lib\classes.zip
  39.   set SWING_HOME=<path to swing release>
  40.   runnit
  41.  
  42.