📄 xuesheng1.java
字号:
package infomanagement;
/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2003</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
import java.awt.*;
import javax.swing.*;
import com.borland.jbcl.layout.*;
import com.borland.dbswing.*;
import com.borland.dx.sql.dataset.*;
import com.borland.dx.dataset.*;
import java.awt.event.*;
import com.borland.jbcl.control.ChoiceControl;
import java.sql.*;
import java.net.URL;
import java.awt.Font;
/**
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2003</p>
* <p>Company: </p>
* @author unascribed
* @version 1.0
*/
public class xuesheng1 extends JDialog {
private JPanel jPanel1 = new JPanel();
private XYLayout xYLayout1 = new XYLayout();
private JLabel jLabel4 = new JLabel("请选择您要进行的操作方式");
private QueryDataSet queryDataSet1 = new QueryDataSet();
private Database database1 = new Database();
private QueryDataSet queryDataSet2 = new QueryDataSet();
private Column column1 = new Column();
ImageIcon icon=new ImageIcon("F:\\图片\\41.jpg");
Image image=icon.getImage();
JLabel jLabel1 ;
JLabel jLabel2 ;
public xuesheng1(Frame frame, String title, boolean modal) {
super(frame, title, modal);
try {
jbInit();
pack();
}
catch(Exception ex) {
ex.printStackTrace();
}
}
public xuesheng1()
{
this(null, "", false);
}
private void jbInit() throws Exception
{
jPanel1.setLayout(xYLayout1);
ImageIcon img = new ImageIcon("D:\\tupian\\kk.jpg");
jLabel1 = new JLabel(img);
jPanel1.add(jLabel1, new Integer(Integer.MIN_VALUE));
jLabel1.setBounds(0, 0, img.getIconWidth(), img.getIconHeight());
jLabel4.setForeground(Color.blue);
ImageIcon imga = new ImageIcon("D:\\tupian\\hh.jpg");
jLabel2 = new JLabel(imga);
this.getLayeredPane().add(jLabel2, new Integer(Integer.MIN_VALUE));
jLabel2.setBounds(0, 0, img.getIconWidth(), img.getIconHeight());
this.setTitle("学生窗口");
//jLabel4.setBorder(BorderFactory.createEtchedBorder());
String driverName = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
String dbURL = "jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=info"; //默认断口为1433
//setSize(500,600);
String userName = "sa"; //SQL用户名
String userPwd = ""; //密码
Connection dbConn;
jLabel4.setFont(new java.awt.Font("宋体", Font.PLAIN, 18));
jLabel1.setText("");
jLabel2.setText("");
jPanel1.add(jLabel4, new XYConstraints(80, 60, -1, -1));
jPanel1.add(jLabel1, new XYConstraints(14, 104, 162, 155));
jPanel1.add(jLabel2, new XYConstraints(196, 104, 191, 160));
JMenuBar jMenuBar1 = new JMenuBar();
JMenu m1=new JMenu("查询");
JMenuItem n1=new JMenuItem("查询");
m1.add(n1);
n1.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
a0(e);
}
});
jMenuBar1.add(m1);
JMenu m2=new JMenu("预定");
JMenuItem n2=new JMenuItem("预定");
m2.add(n2);
n2.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
a1(e);
}
});
jMenuBar1.add(m2);
this.getContentPane().add(jMenuBar1, BorderLayout.NORTH);
try
{
Class.forName(driverName);
dbConn = DriverManager.getConnection(dbURL, userName, userPwd);
}
catch(SQLException ex)
{
}
// database1.setConnection(new com.borland.dx.sql.dataset.ConnectionDescriptor
// ("jdbc:odbc:local", "sa", "", false,
// "sun.jdbc.odbc.JdbcOdbcDriver"));
column1.setColumnName("NewColumn1");
column1.setDataType(com.borland.dx.dataset.Variant.STRING);
column1.setPreferredOrdinal(0);
column1.setServerColumnName("NewColumn1");
column1.setSqlType(0);
this.getContentPane().add(jPanel1, BorderLayout.CENTER);
}
void a0(ActionEvent e)
{
shuchaxun dlg=new shuchaxun();
Dimension dlgSize = dlg.getPreferredSize();
Dimension frmSize = getSize();
Point loc = getLocation();
dlg.setLocation((frmSize.width - dlgSize.width) / 2 +
loc.x, (frmSize.height - dlgSize.height) / 2 + loc.y);
dlg.setModal(true);
dlg.pack();
dlg.setVisible(true);
}
void a1(ActionEvent e)
{
yuding dlg=new yuding();
Dimension dlgSize = dlg.getPreferredSize();
Dimension frmSize = getSize();
Point loc = getLocation();
dlg.setLocation((frmSize.width - dlgSize.width) / 2 +
loc.x, (frmSize.height - dlgSize.height) / 2 + loc.y);
dlg.setModal(true);
dlg.pack();
dlg.setVisible(true);
}
void cancel(){
dispose() ;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -