📄 manipulatetoolbarframe.java
字号:
package dbswing;import java.awt.*;import java.awt.event.*;import javax.swing.*;import com.borland.dx.sql.dataset.*;import com.borland.dbswing.*;public class ManipulateToolbarFrame extends JFrame { JPanel contentPane; BorderLayout borderLayout1 = new BorderLayout(); Database database1 = new Database(); QueryDataSet queryDataSet1 = new QueryDataSet(); TableScrollPane tableScrollPane1 = new TableScrollPane(); JdbTable jdbTable1 = new JdbTable(); JdbNavToolBar jdbNavToolBar1 = new JdbNavToolBar(); public ManipulateToolbarFrame() { try { jbInit(); } catch(Exception e) { e.printStackTrace(); } } private void jbInit() throws Exception { contentPane = (JPanel) this.getContentPane(); contentPane.setLayout(borderLayout1); this.setSize(new Dimension(400, 300)); this.setTitle("数据操作类示例"); //建立与SQLServer的books数据库的联接 database1.setConnection(new com.borland.dx.sql.dataset.ConnectionDescriptor( "jdbc:microsoft:sqlserver://bemyfriend:1433;DatabaseName=books", "sa", "", false, "com.microsoft.jdbc.sqlserver.SQLServerDriver")); //取得bookcategory数据表的记录 queryDataSet1.setQuery(new com.borland.dx.sql.dataset.QueryDescriptor( database1, "select * from bookcategory", null, true, Load.ALL)); jdbTable1.setDataSet(queryDataSet1); jdbNavToolBar1.setDataSet(queryDataSet1); contentPane.add(tableScrollPane1, BorderLayout.CENTER); contentPane.add(jdbNavToolBar1, BorderLayout.NORTH); tableScrollPane1.getViewport().add(jdbTable1, null); } protected void processWindowEvent(WindowEvent e) { if (e.getID() == WindowEvent.WINDOW_CLOSING) { System.exit(0); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -