?? mydatamoduleappframe.java
字號:
package mydatamoduleapp;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 myDataModuleAppFrame extends JFrame { JPanel contentPane; BorderLayout borderLayout1 = new BorderLayout(); DataModule1 dataModule11; QueryDataSet queryDataSet1 = new QueryDataSet(); JdbNavToolBar jdbNavToolBar1 = new JdbNavToolBar(); TableScrollPane tableScrollPane1 = new TableScrollPane(); JdbTable jdbTable1 = new JdbTable(); JPanel jPanel1 = new JPanel(); JButton jButton1 = new JButton(); /**Construct the frame*/ public myDataModuleAppFrame() { enableEvents(AWTEvent.WINDOW_EVENT_MASK); try { jbInit(); } catch(Exception e) { e.printStackTrace(); } } /**Component initialization*/ private void jbInit() throws Exception { //setIconImage(Toolkit.getDefaultToolkit().createImage(myDataModuleAppFrame.class.getResource("[Your Icon]"))); contentPane = (JPanel) this.getContentPane(); dataModule11 = mydatamoduleapp.DataModule1.getDataModule(); queryDataSet1.setQuery(new com.borland.dx.sql.dataset.QueryDescriptor(dataModule11.getDatabase1(), "select * from studentbase", null, true, Load.ALL)); contentPane.setLayout(borderLayout1); this.setSize(new Dimension(400, 300)); this.setTitle("JBuilder數據模塊的應用"); jdbTable1.setDataSet(dataModule11.getStudentbase()); jdbNavToolBar1.setDataSet(dataModule11.getStudentbase()); jPanel1.setPreferredSize(new Dimension(100, 100)); jButton1.setText("顯示地址表數據"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { jButton1_actionPerformed(e); } }); contentPane.add(jdbNavToolBar1, BorderLayout.NORTH); contentPane.add(tableScrollPane1, BorderLayout.WEST); contentPane.add(jPanel1, BorderLayout.SOUTH); jPanel1.add(jButton1, null); 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); } } void jButton1_actionPerformed(ActionEvent e) { myDataModuleAppFrame1 frame1 = new myDataModuleAppFrame1(); frame1.setSize(new Dimension(400, 300)); frame1.setTitle("JBuilder數據模塊的應用"); frame1.show(); }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -