?? databaseappframe.java
字號:
package mydatabaseapp;import java.awt.*;import java.awt.event.*;import javax.swing.*;import com.borland.dx.sql.dataset.*;import com.borland.dbswing.*;/** * Title: JBuilder組件操縱數據庫 * Description: Java語言演示程序:JBuilder組件操縱數據庫,用于北京師范大學計算機系Java課程教學示范。 * Copyright: Copyright (c) 2002 * Company: 北京師范大學計算機系 * @author 孫一林 * @version 1.0 */public class databaseAppFrame extends JFrame { JPanel contentPane; BorderLayout borderLayout1 = new BorderLayout(); Database database1 = new Database(); QueryDataSet queryDataSet1 = new QueryDataSet(); JdbNavToolBar jdbNavToolBar1 = new JdbNavToolBar(); JdbTable jdbTable1 = new JdbTable(); JdbStatusLabel jdbStatusLabel1 = new JdbStatusLabel(); /**Construct the frame*/ public databaseAppFrame() { enableEvents(AWTEvent.WINDOW_EVENT_MASK); try { jbInit(); } catch(Exception e) { e.printStackTrace(); } } /**Component initialization*/ private void jbInit() throws Exception { queryDataSet1.setQuery(new com.borland.dx.sql.dataset.QueryDescriptor(database1, "select * from studentbase", null, true, Load.ALL)); database1.setConnection(new com.borland.dx.sql.dataset.ConnectionDescriptor("jdbc:odbc:student", "student", "123456", false, "sun.jdbc.odbc.JdbcOdbcDriver")); //setIconImage(Toolkit.getDefaultToolkit().createImage(databaseAppFrame.class.getResource("[Your Icon]"))); contentPane = (JPanel) this.getContentPane(); contentPane.setLayout(borderLayout1); this.setSize(new Dimension(400, 300)); this.setTitle("JBuilder組件操縱數據庫"); jdbTable1.setDataSet(queryDataSet1); jdbNavToolBar1.setDataSet(queryDataSet1); jdbStatusLabel1.setText("jdbStatusLabel1"); jdbStatusLabel1.setDataSet(queryDataSet1); contentPane.add(jdbNavToolBar1, BorderLayout.NORTH); contentPane.add(jdbTable1, BorderLayout.CENTER); contentPane.add(jdbStatusLabel1, BorderLayout.SOUTH); } /**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 + -