📄 dbfm.java
字号:
package dblx;
import java.awt.BorderLayout;
import java.awt.Dimension;
import javax.swing.JFrame;
import javax.swing.JPanel;
import com.borland.dx.sql.dataset.Database;
import com.borland.dx.sql.dataset.*;
import com.borland.jbcl.layout.XYLayout;
import com.borland.jbcl.layout.*;
import javax.swing.JLabel;
import com.borland.dbswing.JdbTextArea;
import com.borland.dbswing.JdbTable;
import com.borland.dbswing.JdbNavToolBar;
import javax.swing.JButton;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class dbfm extends JFrame {
JPanel contentPane;
Database database1 = new Database();
QueryDataSet queryDataSet1 = new QueryDataSet();
XYLayout xYLayout1 = new XYLayout();
JLabel jLabel1 = new JLabel();
JLabel jLabel2 = new JLabel();
JLabel jLabel3 = new JLabel();
JLabel jLabel4 = new JLabel();
JLabel jLabel5 = new JLabel();
JdbTextArea jdbTextArea1 = new JdbTextArea();
JdbTextArea jdbTextArea2 = new JdbTextArea();
JdbTextArea jdbTextArea3 = new JdbTextArea();
JdbTextArea jdbTextArea4 = new JdbTextArea();
JdbTextArea jdbTextArea5 = new JdbTextArea();
JdbTable jdbTable1 = new JdbTable();
JdbNavToolBar jdbNavToolBar1 = new JdbNavToolBar();
public dbfm() {
try {
setDefaultCloseOperation(EXIT_ON_CLOSE);
jbInit();
} catch (Exception exception) {
exception.printStackTrace();
}
}
/**
* Component initialization.
*
* @throws java.lang.Exception
*/
private void jbInit() throws Exception {
contentPane = (JPanel) getContentPane();
contentPane.setLayout(xYLayout1);
setSize(new Dimension(400, 300));
setTitle("数据库练习");
database1.setConnection(new ConnectionDescriptor(
"jdbc:borland:dslocal:J:\\lx\\lx.jds", "SYSDBA", "masterkey", false,
"com.borland.datastore.jdbc.DataStoreDriver"));
queryDataSet1.setQuery(new com.borland.dx.sql.dataset.QueryDescriptor(
database1, "select * from student", null, true, Load.ALL));
jLabel1.setToolTipText("");
jLabel1.setText("学号");
jLabel2.setToolTipText("");
jLabel2.setText("姓名");
jLabel3.setToolTipText("");
jLabel3.setText("性别");
jLabel4.setToolTipText("");
jLabel4.setText("出生日期");
jLabel5.setToolTipText("");
jLabel5.setText("家庭住址");
jdbTextArea1.setText("jdbTextArea1");
jdbTextArea1.setColumnName("XH");
jdbTextArea1.setDataSet(queryDataSet1);
jdbTextArea2.setText("jdbTextArea1");
jdbTextArea2.setColumnName("XM");
jdbTextArea2.setDataSet(queryDataSet1);
jdbTextArea3.setText("jdbTextArea1");
jdbTextArea3.setColumnName("XB");
jdbTextArea3.setDataSet(queryDataSet1);
jdbTextArea4.setText("jdbTextArea1");
jdbTextArea4.setColumnName("CSRQ");
jdbTextArea4.setDataSet(queryDataSet1);
jdbTextArea5.setText("jdbTextArea1");
jdbTextArea5.setColumnName("JTZZ");
jdbTextArea5.setDataSet(queryDataSet1);
jdbTable1.setDataSet(queryDataSet1);
jdbNavToolBar1.setDataSet(queryDataSet1);
contentPane.add(jLabel1, new XYConstraints(30, 48, 64, 21));
contentPane.add(jLabel2, new XYConstraints(30, 70, -1, -1));
contentPane.add(jLabel3, new XYConstraints(30, 91, -1, -1));
contentPane.add(jLabel4, new XYConstraints(31, 112, -1, -1));
contentPane.add(jLabel5, new XYConstraints(31, 134, -1, -1));
contentPane.add(jdbTextArea1, new XYConstraints(87, 47, -1, 16));
contentPane.add(jdbTextArea2, new XYConstraints(87, 65, -1, -1));
contentPane.add(jdbTextArea3, new XYConstraints(87, 85, -1, -1));
contentPane.add(jdbTextArea4, new XYConstraints(86, 109, -1, -1));
contentPane.add(jdbTextArea5, new XYConstraints(86, 131, -1, -1));
contentPane.add(jdbTable1, new XYConstraints(32, 160, 338, 128));
contentPane.add(jdbNavToolBar1, new XYConstraints(22, 8, 337, 37));
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -