📄 buttontablepanel.java~6~
字号:
package superframe.factionpanels;
import javax.swing.JPanel;
import com.borland.jbcl.layout.XYLayout;
import com.borland.jbcl.layout.*;
import javax.swing.JScrollPane;
import com.borland.dbswing.TableScrollPane;
import com.borland.dbswing.JdbStatusLabel;
import com.borland.dbswing.JdbTable;
import com.borland.dx.sql.dataset.Database;
import com.borland.dx.sql.dataset.QueryDataSet;
import com.borland.dx.sql.dataset.QueryDescriptor;
import com.borland.dx.sql.dataset.Load;
import javax.swing.JButton;
import javax.swing.JTable;
import com.borland.dx.sql.dataset.ConnectionDescriptor;
import superframe.link.SQLRunner;
public class ButtonTablePanel extends JPanel{
public ButtonTablePanel() {
try {
jbInit();
} catch (Exception ex) {
ex.printStackTrace();
}
}
public void resetTable(String sql){
//this.sql=sql;
if(sql==null)return;
queryDataSet1.closeStatement();
queryDataSet1.setQuery(new QueryDescriptor(database1, sql, null, true,
Load.ALL));
queryDataSet1.refresh();
}
private void jbInit() throws Exception {
this.setLayout(xYLayout1);
jdbStatusLabel1.setText("jdbStatusLabel1");
jdbTable1.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
jdbTable1.setDataSet(queryDataSet1);
queryDataSet1.setQuery(new QueryDescriptor(database1, "", null, true,
Load.ALL));
jButton1.setText("新建");
database1.setConnection(new ConnectionDescriptor(
SQLRunner.url,SQLRunner.userID, SQLRunner.password, false,
SQLRunner.jdbcDriver));
database1.setDatabaseName("");
this.add(tableScrollPane1, new XYConstraints(0, 0, 671, 430));
tableScrollPane1.getViewport().add(jdbTable1);
this.add(jButton1, new XYConstraints(550, 435, 76, 30));
this.add(jdbStatusLabel1, new XYConstraints(0, 430, 670, 40));
}
XYLayout xYLayout1 = new XYLayout();
TableScrollPane tableScrollPane1 = new TableScrollPane();
JdbStatusLabel jdbStatusLabel1 = new JdbStatusLabel();
JdbTable jdbTable1 = new JdbTable();
Database database1 = new Database();
QueryDataSet queryDataSet1 = new QueryDataSet();
JButton jButton1 = new JButton();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -