📄 qwczdialog.java~19~
字号:
package myproject;
import java.awt.*;
import javax.swing.*;
import com.borland.jbcl.layout.*;
import javax.swing.border.*;
import java.awt.event.*;
import java.sql.Connection;
import java.sql.Statement;
import java.sql.SQLException;
/**
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2005</p>
* <p>Company: </p>
* @author unascribed
* @version 1.0
*/
public class QwczDialog extends JDialog {
private JPanel panel1 = new JPanel();
private JLabel jLabel1 = new JLabel();
private XYLayout xYLayout1 = new XYLayout();
private JTextField indexField = new JTextField();
private JButton jButton1 = new JButton();
private JButton jButton2 = new JButton();
private Border border1;
Connection con = null;
public QwczDialog(Frame2 frame, String title, boolean modal) {
super(frame, title, modal);
try {
this.con = frame.con1;
jbInit();
pack();
}
catch(Exception ex) {
ex.printStackTrace();
}
}
public QwczDialog() {
this(null, "查找", false);
}
private void jbInit() throws Exception {
border1 = BorderFactory.createEmptyBorder(0,10,15,10);
panel1.setLayout(xYLayout1);
jLabel1.setText("请输入索引号:");
jButton1.setText("查找");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(ActionEvent e) {
jButton1_actionPerformed(e);
}
});
jButton2.setText("取消");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(ActionEvent e) {
jButton2_actionPerformed(e);
}
});
getContentPane().add(panel1);
panel1.setBorder(border1);
panel1.add(jLabel1, new XYConstraints(17, 28, 88, 30));
panel1.add(indexField, new XYConstraints(118, 31, 210, 27));
panel1.add(jButton2, new XYConstraints(413, 29, -1, -1));
panel1.add(jButton1, new XYConstraints(344, 29, -1, -1));
}
void jButton2_actionPerformed(ActionEvent e) {
this.setVisible(false);
this.dispose();
}
void jButton1_actionPerformed(ActionEvent e) {
try{
String indexStr = indexField.getText();
Statement sta = con.createStatement();
String sql = "select tiaowen from fltw where sy_id='"+indexStr+"'";
}
catch(SQLException ex){
ex.printStackTrace();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -