A recent project was developed by delphi, where data tables are used in many areas. This function can be easily implemented in delphi and vb. java does not
This function is provided, but can be implemented using Jtable, but it is a bit of trouble :).
The following is a simple data table program code that I implemented using applet.
Package com. applet. cat10;
Import java. awt .*;
Import java. awt. event .*;
Import java. applet .*;
Import javax. swing .*;
Import com. util .*;
Import java. util .*;
Import javax. swing. table .*;
Import java. SQL .*;
/**
* Title: Cat project
* Description: BCat
* Copyright: Copyright (c) 2001
* Company: smartcomm
* @ Author daniel
* @ Version 1.0
*/
Public class TestDatabase extends JApplet {
Boolean isStandalone = false;
JButton jButton1 = new JButton (); // trigger time query button
Database db = new Database ();
JTable table1 = new JTable ();
JScrollPane scroll = new JScrollPane ();
JTextField text1 = new JTextField ();
DefaultTableModel dtm; // defines the table data model.
Vector vCdata = null; // define the table column name (stored in vector)
ResultSet rsRow = null; // query the data set of the table.
/** Construct the applet */
Public TestDatabase (){
}
/** Initialize the applet */
Public void init (){
Try {
JbInit ();
UserInit (); // user-defined operations are in the Power Method
}
Catch (Exception e ){
E. printStackTrace ();
}
}
/** Component initialization */
Private void jbInit () throws Exception {
JButton1.setText ("jButton1 ");