Java Reference
In-Depth Information
protected JTable table;
protected JTextArea SQLPane = new JTextArea();
protected JButton createButton = new JButton("Create Table");
protected ActionListener commandListener = null;
protected String tableName = null;
protected String SQLCommand = "";
protected String SQLCommandRoot = "";
public TableBuilderFrame(String tableName){
setSize(600,400);
setLocation(10,10);
setClosable(true);
setMaximizable(true);
setIconifiable(true);
setResizable(true);
getContentPane().setLayout(new BorderLayout());
this.tableName=tableName;
SQLCommandRoot = "CREATE TABLE "+tableName;
setTitle(SQLCommandRoot);
init();
setVisible(true);
}
// initialise the JInternalFrame
private void init(){
table = createTable(nRows);
TableChangeListener modelListener = new TableChangeListener ();
table.getModel().addTableModelListener(modelListener);
JScrollPane sqlScroller = new JScrollPane(SQLPane);
JScrollPane tableScroller = new JScrollPane(table);
JSplitPane splitter = new
JSplitPane(JSplitPane.VERTICAL_SPLIT,sqlScroller,tableScroller);
splitter.setDividerLocation(100);
Search WWH ::




Custom Search