⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dbnavframe.java

📁 Java灵感编程1-101之21-40
💻 JAVA
字号:
package dbnav;import java.awt.*;import java.awt.event.*;import javax.swing.*;import com.borland.dx.sql.dataset.*;import com.borland.dbswing.*;/** * <p>Title: dbNav Demo</p> * <p>Description: This is a dbNav demo</p> * <p>Copyright: Copyright (c) 2002</p> * <p>Company: d6-125</p> * @author Liujun * @version 1.0 *//** * <p>Title: db Nav Demo</p> * <p>Description: This is a db Nav demo</p> * <p>Copyright: Copyright (c) 2002</p> * <p>Company: d6-125</p> * @author Liujun * @version 1.0 */public class dbNavFrame extends JFrame {  JPanel contentPane; // JLabel statusBar = new JLabel();  BorderLayout borderLayout1 = new BorderLayout();  Database database1 = new Database();  QueryDataSet queryDataSet1 = new QueryDataSet();  TableScrollPane tableScrollPane1 = new TableScrollPane();  JdbTable jdbTable1 = new JdbTable();  JdbNavToolBar jdbNavToolBar1 = new JdbNavToolBar();  JdbStatusLabel jdbStatusLabel1 = new JdbStatusLabel();  //Construct the frame  public dbNavFrame() {    enableEvents(AWTEvent.WINDOW_EVENT_MASK);    try {      jbInit();    }    catch(Exception e) {      e.printStackTrace();    }  }  //Component initialization  private void jbInit() throws Exception  {    //setIconImage(Toolkit.getDefaultToolkit().createImage(dbNavFrame.class.getResource("[Your Icon]")));    contentPane = (JPanel) this.getContentPane();    contentPane.setLayout(borderLayout1);    this.setSize(new Dimension(400, 300));    this.setTitle("db Nav Frame Demo");//    statusBar.setText(" ");    database1.setConnection(new com.borland.dx.sql.dataset.ConnectionDescriptor("jdbc:borland:dslocal:L:\\jb6exam\\dbNav\\dbNav\\dbNav.jds", "SYSDBA", "password", false, "com.borland.datastore.jdbc.DataStoreDriver"));    queryDataSet1.setQuery(new com.borland.dx.sql.dataset.QueryDescriptor(database1, "SELECT \"student\".\"出生地点\",\"student\".\"出生年月\",\"student\".\"姓名\",\"student\".\"学号\",\"student\".\"性别\",\"student\".\"籍贯\" " +      "FROM\"student\"", null, true, Load.ALL));    jdbTable1.setDataSet(queryDataSet1);    jdbNavToolBar1.setDataSet(queryDataSet1);    jdbStatusLabel1.setText("jdbStatusLabel2");    jdbStatusLabel1.setDataSet(queryDataSet1); //   contentPane.add(statusBar, BorderLayout.SOUTH);    contentPane.add(tableScrollPane1, BorderLayout.CENTER);    contentPane.add(jdbNavToolBar1, BorderLayout.NORTH);    contentPane.add(jdbStatusLabel1,  BorderLayout.SOUTH);    tableScrollPane1.getViewport().add(jdbTable1, null);  }  //Overridden so we can exit when window is closed  protected void processWindowEvent(WindowEvent e) {    super.processWindowEvent(e);    if (e.getID() == WindowEvent.WINDOW_CLOSING) {      System.exit(0);    }  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -