import java.sql.*;
import java.util.Vector;
import java.lang.String;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.table.*;
public class fx extends JFrame
{
Connection fei;
PreparedStatement S;
int ma;
JTextField r5[]={new JTextField(15),new JTextField(15)};
fx()
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
fei=DriverManager.getConnection("jdbc:odbc:source");
}
catch(Exception e)
{
System.err.println("异常: " + e.getMessage( ));
}
final JFrame fr = new JFrame("☆信 息 管 理 学 院 图 书 室 欢 迎 你☆" );
fr.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
fr.setSize(900,700);
Container c = fr.getContentPane( );
c.setLayout( new FlowLayout(FlowLayout.CENTER,0,0) );
ImageIcon mh[]={new ImageIcon("4.jpg"),new ImageIcon("5.jpg")};
c.add(new JLabel(mh[0]));
//*****************图片标签和文字标签***********
ImageIcon [ ] i3 = { new ImageIcon( "a1.jpg"),new ImageIcon( "a2.jpg"),new ImageIcon( "a3.jpg"),new ImageIcon( "a4.jpg"),new ImageIcon( "a5.jpg")};
JButton b[]={new JButton(i3[0]),new JButton(i3[1]),new JButton(i3[2]),new JButton(i3[3]),new JButton(i3[4])};
JPanel u=new JPanel();
u.setPreferredSize(new Dimension(95,50));
u.setLayout(new FlowLayout(FlowLayout.CENTER,0,0));
c.add(u);
for(int i=0;i<5;i++)
c.add(b[i]);
c.add(new JLabel(mh[1]));
fr.setVisible(true);
//*************读者注册监听*************
b[0].addActionListener(new ActionListener()
{public void actionPerformed(ActionEvent e)
{ JButton b1= (JButton)e.getSource();
final JDialog app = new JDialog(fr,"☆信息管理图书室☆",true );
app.setDefaultCloseOperation(HIDE_ON_CLOSE);
app.setSize(600,500);
Container c = app.getContentPane();
c.setLayout(new FlowLayout(FlowLayout.CENTER,55,10));
JPanel u=new JPanel();
u.setPreferredSize(new Dimension(600,25));
u.setBackground(Color.yellow);
JLabel q=new JLabel(" * 读 者 基 本 信 息 登 记 * ");
u.setLayout(new FlowLayout(FlowLayout.CENTER));
u.add(q);
c.add(u);
JPanel ub=new JPanel();
ub.setPreferredSize(new Dimension(600,350));
ub.setLayout(new FlowLayout(FlowLayout.CENTER,70,20));
ImageIcon [ ] ic3 = { new ImageIcon( "b.jpg"),new ImageIcon("w.jpg"),new ImageIcon( "j.jpg"),new ImageIcon( "q.jpg")};
JLabel w[]={new JLabel(ic3[0],JLabel.CENTER),
new JLabel(ic3[1],JLabel.CENTER),new JLabel(ic3[2],JLabel.CENTER),new JLabel(ic3[3],JLabel.CENTER)};
final String s[]={"","信息管理","金融","马克思主义","文化传播","会计","华商","中德","
经济","管理工程"};
final JComboBox cb=new JComboBox(s);
cb.setEditable(true); JPanel uah=new JPanel();
uah.setPreferredSize(new Dimension(600,40));
uah.setBackground(Color.yellow);
uah.setLayout(new FlowLayout(FlowLayout.CENTER,180,10));
JButton vi=new JButton("
注册o(≧v≦)o");
final JTextField []nu={new JTextField(10),new JTextField(10),new JTextField(10)};
ub.add(w[0]);
ub.add(nu[0]);
ub.add(w[1]);
ub.add(nu[1]);
ub.add(w[2]);
ub.add(cb);
ub.add(w[3]);
ub.add(nu[2]);
c.add(ub);
uah.add(vi);
c.add(uah);
//******************确定
sql监听*******************
vi.addActionListener(new ActionListener( )
{
public void actionPerformed(ActionEvent e)
{
JButton vi=(JButton)e.getSource();
try
{ for(int i=1;i
{ if(cb.getSelected