Posted Saturday, October 7, 2006 @ 14:44:29
I did get an email from the quicktable admin and replied with more details
the table havs 6 columns and all display as expected without the getColumn code code. the listing below should display what i am doing. the compile works, running it produces "Column 4 is not avail..." i have tried both the free version and the version i downloaded after paying.
thanks
import javax.swing.*;
import quick.dbtable.*;
import java.sql.*;
import java.awt.*;
import java.awt.event.*;
import java.util.Hashtable;
import java.io.*;
public class MakeFrame extends JFrame {
public MakeFrame() {
JFrame mainFrame = new JFrame("MakeFrame");
mainFrame.setLocation(100, 100);
mainFrame.setSize(800, 300);
Container container1 = mainFrame.getContentPane();
JPanel topPanel = new JPanel();
JPanel bottomPanel = new JPanel();
JTextField queryText = new JTextField("select * from alarms");
topPanel.add(queryText);
final quick.dbtable.DBTable dBTable1 = new quick.dbtable.DBTable();
dBTable1.debug=true;
JPanel panel1 = new JPanel();
bottomPanel.add(dBTable1);
dBTable1.setDatabaseDriver("com.mysql.jdbc.Driver");
dBTable1.setJdbcUrl("jdbc:mysql://localhost:3306/test");
dBTable1.setSelectSql("select * from alarms");
dBTable1.addDeleteSql("delete from alarms where id = ?", "1");
// set the columns as we want
// id
Column col;
col = dBTable1.getColumn(0); col.setPreferredWidth(10); col.setReadOnly(true);
col = dBTable1.getColumn(1); col.setPreferredWidth(4); col.setReadOnly(true);
// see col 2 below
col = dBTable1.getColumn(3); col.setPreferredWidth(12); col.setReadOnly(true);
col = dBTable1.getColumn(4); col.setPreferredWidth(32); col.setReadOnly(true);