📄 mydatamoduleappframe.java
字号:
package mydatamoduleapp;import java.awt.*;import java.awt.event.*;import javax.swing.*;import com.borland.dx.sql.dataset.*;import com.borland.dbswing.*;import com.borland.dx.dataset.*;/** * 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(); TableScrollPane tableScrollPane1 = new TableScrollPane(); JdbNavToolBar jdbNavToolBar1 = new JdbNavToolBar(); JdbStatusLabel jdbStatusLabel1 = new JdbStatusLabel(); JdbTable jdbTable1 = new JdbTable(); DataSetView dataSetView1 = new DataSetView(); /**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 studentbase.\"学号\",studentbase.\"姓名\",studentbase.\"年龄\",studentbase.\"性别\",studentbase.\"系名\" " + "FROM\"D:\\DataBase\\student\".studentbase", null, true, Load.ALL)); contentPane.setLayout(borderLayout1); this.setSize(new Dimension(400, 300)); this.setTitle("JBuilder数据模块的应用"); jdbStatusLabel1.setText("jdbStatusLabel1"); jdbStatusLabel1.setDataSet(queryDataSet1); dataSetView1.setMasterLink(new com.borland.dx.dataset.MasterLinkDescriptor(queryDataSet1, new String[] {"年龄", "性别"}, new String[] {"年龄", "性别"}, false, false, false)); dataSetView1.setSort(new com.borland.dx.dataset.SortDescriptor("", null, new boolean[] {}, null, 0)); dataSetView1.setStorageDataSet(queryDataSet1); jdbTable1.setDataSet(dataSetView1); jdbNavToolBar1.setDataSet(queryDataSet1); contentPane.add(jdbNavToolBar1, BorderLayout.NORTH); contentPane.add(jdbStatusLabel1, BorderLayout.SOUTH); contentPane.add(tableScrollPane1, BorderLayout.CENTER); 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 + -