import java.lang.*;
import java.lang.Object.*;
import java.sql.*;
import java.util.*;
import javax.swing.event.*;
import javax.swing.table.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Frame1 extends JFrame
{
JPanel contentPane;
JLabel jLabel1 = new JLabel();
JLabel jLabel2 = new JLabel();
JLabel jLabel3 = new JLabel();
JLabel jLabel4 = new JLabel();
JTextField jTextField1 = new JTextField();
JTextField jTextField2 = new JTextField();
JTextField jTextField3 = new JTextField();
JTextField jTextField4 = new JTextField();
JButton jButton1 = new JButton();
JButton jButton2 = new JButton();
JButton jButton3 = new JButton();
JButton jButton4 = new JButton();
String guangpan[] = {"编号","光盘名称","光盘信息","购买时间"}; // 二维表列名
Connection connection = null; // 声明Connection接口对象connection
ResultSet rSet = null; // 定义数据库查询的结果集
Statement statement = null; // 定义查询数据库的Statement对象
JMenuBar jMenuBar1 = new JMenuBar();
JMenu jMenu1 = new JMenu();
JMenu jMenuhelp = new JMenu();
JMenuItem jMenuabout = new JMenuItem();
JMenuItem jMenuexit = new JMenuItem();
JTextPane jTextPane1 = new JTextPane();
JLabel jLabel5 = new JLabel();
JTextField jTextField5 = new JTextField();
JButton jButton5 = new JButton();
//Construct the frame
public Frame1()
{
enableEvents(AWTEvent.WINDOW_EVENT_MASK);
try
{
jbInit();
}
catch (Exception e)
{
e.printStackTrace();
}
}
//Component initialization
public void jbInit() throws Exception
{
contentPane = (JPanel) this.getContentPane();
jLabel1.setFont(new java.awt.Font("Dialog", 0, 15));
jLabel1.setForeground(Color.black);
jLabel1.setDebugGraphicsOptions(0);
jLabel1.setToolTipText("");
jLabel1.setVerifyInputWhenFocusTarget(true);
jLabel1.setHorizontalAlignment(SwingConstants.RIGHT);
jLabel1.setIconTextGap(4);
jLabel1.setText("编号:");
jLabel1.setBounds(new Rectangle(47, 98, 47, 23));
contentPane.setLayout(null);
this.setSize(new Dimension(400, 341));
this.setState(Frame.NORMAL);
this.setTitle("光盘信息管理信息表");
jLabel2.setFont(new java.awt.Font("Dialog", 0, 15));
jLabel2.setToolTipText("");
jLabel2.setHorizontalAlignment(SwingConstants.RIGHT);
jLabel2.setText("光盘名称:");
jLabel2.setBounds(new Rectangle(40, 137, 68, 25));
jLabel3.setFont(new java.awt.Font("Dialog", 0, 15));
jLabel3.setToolTipText("");
jLabel3.setHorizontalAlignment(SwingConstants.RIGHT);
jLabel3.setText("光盘信息:");
jLabel3.setBounds(new Rectangle(34, 173, 68, 27));
jLabel4.setFont(new java.awt.Font("Dialog", 0, 15));
jLabel4.setHorizontalAlignment(SwingConstants.RIGHT);
jLabel4.setText("购买时间:");
jLabel4.setBounds(new Rectangle(28, 215, 71, 29));
jTextField1.setText("");
jTextField1.setBounds(new Rectangle(106, 95, 95, 27));
jTextField2.setText("");
jTextField2.setBounds(new Rectangle(107, 136, 93, 28));
jTextField3.setText("");
jTextField3.setBounds(new Rectangle(108, 174, 91, 25));
jTextField4.setText("");
jTextField4.setBounds(new Rectangle(108, 212, 91, 26));
jButton1.setBounds(new Rectangle(250, 95, 73, 31));
jButton1.setFont(new java.awt.Font("Dialog", 0, 15));
jButton1.setToolTipText("");
jButton1.setText("修改");
jButton1.addActionListener(new Frame1_jButton1_actionAdapter(this));
jButton2.setBounds(new Rectangle(250, 146, 74, 34));
jButton2.setFont(new java.awt.Font("Dialog", 0, 15));
jButton2.setToolTipText("");
jButton2.setVerifyInputWhenFocusTarget(true);
jButton2.setText("添加");
jButton2.addActionListener(new Frame1_jButton2_actionAdapter(this));
jButton3.setBounds(new Rectangle(213, 250, 75, 28));
jButton3.setFont(new java.awt.Font("Monospaced", 1, 15));
jButton3.setToolTipText("");
jButton3.setText("删除");
jButton3.addActionListener(new Frame1_jButton3_actionAdapter(this));
jButton4.setBounds(new Rectangle(253, 201, 73, 36));
jButton4.setFont(new java.awt.Font("Dialog", 0, 15));
jButton4.setToolTipText("");
jButton4.setText("取消");
jButton4.addActionListener(new Frame1_jButton4_actionAdapter(this));
jTextPane1.setBackground(SystemColor.control);
jTextPane1.setFont(new java.awt.Font("Dialog", 0, 14));
jTextPane1.setBorder(BorderFactory.createLoweredBevelBorder());
jTextPane1.setEditable(false);
jTextPane1.setText("");
jTextPane1.setBounds(new Rectangle(40, 1, 316, 86));
jLabel5.setFont(new java.awt.Font("Monospaced", 1, 15));
jLabel5.setOpaque(true);
jLabel5.setPreferredSize(new Dimension(94, 22));
jLabel5.setRequestFocusEnabled(false);
jLabel5.setToolTipText("");
jLabel5.setHorizontalAlignment(SwingConstants.RIGHT);
jLabel5.setHorizontalTextPosition(SwingConstants.TRAILING);
jLabel5.setIconTextGap(4);
jLabel5.setText("客户姓名: ");
jLabel5.setVerticalAlignment(SwingConstants.CENTER);
jLabel5.setVerticalTextPosition(SwingConstants.CENTER);
jLabel5.setBounds(new Rectangle(5, 245, 109, 38));
jTextField5.setFont(new java.awt.Font("Dialog", 0, 15));
jTextField5.setCaretPosition(0);
jTextField5.setText("");
jTextField5.setColumns(0);
jTextField5.setBounds(new Rectangle(107, 251, 94, 28));
jButton5.setBounds(new Rectangle(315, 249, 75, 30));
jButton5.setFont(new java.awt.Font("Monospaced", 1, 15));
jButton5.setToolTipText("");
jButton5.setText("查询");
jButton5.addActionListener(new action());
contentPane.add(jTextPane1, null);
contentPane.add(jTextField5, null);
contentPane.add(jButton5);
contentPane.add(jButton3, null);
contentPane.add(jTextField4, null);
contentPane.add(jTextField3, null);
contentPane.add(jTextField2, null);
contentPane.add(jTextField1, null);
contentPane.add(jLabel4, null);
contentPane.add(jLabel5, null);
contentPane.add(jLabel3, null);
contentPane.add(jLabel2, null);
contentPane.add(jLabel1, null);
contentPane.add(jButton4, null);
contentPane.add(jButton2, null);
contentPane.add(jButton1, null);
jMenu1.addSeparator();
jMenu1.add(jMenuexit);
this.setJMenuBar(jMenuBar1);
}
//File | Exit action performed
public void jMenuexit_ActionPerformed(ActionEvent e)
{
System.exit(0);
}
//Help | About action performed
public void jMenuabout_ActionPerformed(ActionEvent e)
{
Frame1_AboutBox dlg = new Frame1_AboutBox(this);
Dimension dlgSize = dlg.getPreferredSize();
Dimension frmSize = getSize();
Point loc = getLocation();
dlg.setLocation( 132 + loc.x,
122 + loc.y);
dlg.setModal(true);
dlg.pack();
dlg.show();
}
//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);
}
}
class Frame1_jMenuabout_ActionAdapter implements ActionListener
{
Frame1 adaptee;
Frame1_jMenuabout_ActionAdapter(Frame1 adaptee)
{
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e)
{
adaptee.jMenuabout_ActionPerformed(e);
}
}
void jButton1_actionPerformed(ActionEvent e) // 处理修改按钮的ActionEvent
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); // 实例化JDBC-ODBC桥的驱动
connection = DriverManager.getConnection("jdbc:odbc:local","sa","hunterd"); // 连接数据库
// 创建Statement接口对象
statement = connection.createStatement();
if (jTextField1.getText().length() == 0)
{
jTextPane1.setText("不能修改,请先输入编号!");
}
else {
if (jT
没有合适的资源?快使用搜索试试~ 我知道了~
java+sql光盘管理系统
共36个文件
class:16个
java:6个
xml:4个
需积分: 9 16 下载量 73 浏览量
2008-12-25
15:57:19
上传
评论
收藏 131KB RAR 举报
温馨提示
这可是我自己的作,可用,可靠,可信哦!!!
资源推荐
资源详情
资源评论
收起资源包目录
.rar (36个子文件)
光盘管理系统
JavaApplication1
test
manifest.mf 85B
src
denglu.java 2KB
Application1.java 908B
Frame1.java 17KB
ShowRecord.java 2KB
Frame1_AboutBox.java 3KB
jinggao.java 1KB
build
classes
Frame1.rs 163B
jinggao$me.class 566B
Frame1_AboutBox.class 4KB
studentinfo
ShowRecord.class 3KB
dong.mdb 100KB
jframe.class 2KB
Frame1$Frame1_jMenuabout_ActionAdapter.class 742B
jinggao$1.class 618B
Frame1$Frame1_jButton3_actionAdapter.class 734B
Frame1$Frame1_jButton2_actionAdapter.class 734B
Frame1$Frame1_jButton4_actionAdapter.class 734B
jinggao.class 2KB
jframe$action.class 1KB
Frame1$Frame1_jButton1_actionAdapter.class 734B
denglu.class 467B
administrator
Frame1$action.class 848B
Application1.class 888B
Frame1.class 14KB
.netbeans_automatic_build 0B
hs_err_pid2320.log 7KB
build.xml 4KB
nbproject
build-impl.xml 33KB
private
private.xml 211B
private.properties 113B
project.properties 2KB
project.xml 586B
genfiles.properties 455B
光盘_Log.LDF 1024KB
光盘_Data.MDF 1024KB
共 36 条
- 1
资源评论
hxd19860509
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功