import java.awt.BorderLayout;
import javax.swing.JDialog;
import javax.swing.JFrame;
import quick.dbtable.*;
public class TestDialog
{
public static void main(String[] args)
{
JFrame parentFrame = new JFrame();
parentFrame.setSize(500, 150);
// Display the parent frame
parentFrame.setVisible(true);
// Create a dialog that will display the progress.
final JDialog dlg = new JDialog(parentFrame, "QuickTable test", true);
DBTable dpb = new DBTable();
dpb.setSelectSql("SELECT Order_Number,Company_Name,Amount,Payment_Type,Paid,In_Stock,Delivery_Type,Status, Client_IP,Invoice_Date from Customer_order");
try
{
//set database properties
dpb.connectDatabase("sun.jdbc.odbc.JdbcOdbcDriver",
"jdbc:odbc:quicktabledemo",
"" ,"");
dpb.refresh();
dpb.setEditable(true);
}
catch(Exception ex)
{
ex.printStackTrace();
}
dlg.getContentPane().setLayout(new BorderLayout());
dlg.getContentPane().add(BorderLayout.CENTER, dpb);
dlg.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
dlg.setSize(500, 300);
dlg.setLocationRelativeTo(parentFrame);
dlg.show();
}
}