我刚简化了下 主程序有1000多行 贴不出来 下面是简化的 你们看看
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import java.sql.*;
public class T111 extends JFrame implements ActionListener
{
JLabel la,la1,la2,la3;
JTextField txt;
JComboBox cb;
JPasswordField pw,pw1;
JButton b1,b2;
String str;
String strs[]={"管理员","普通管理员"};
T111()
{
Container c=getContentPane();
c.setLayout(null);
Font f=new Font("华文细黑",Font.BOLD,15);
la=new JLabel("管理员帐号:");
la.setBounds(8,10,200,30);
la.setFont(f);
c.add(la);
la1=new JLabel("请输入密码:");
la1.setBounds(8,50,200,30);
la1.setFont(f);
c.add(la1);
la2=new JLabel("请重新输入:");
la2.setBounds(8,90,200,30);
la2.setFont(f);
c.add(la2);
la3=new JLabel("管理员级别");
la3.setBounds(8,130,200,30);
la3.setFont(f);
c.add(la3);
cb=new JComboBox(strs);
cb.setBounds(100,130,110,30);
cb.setFont(f);
c.add(cb);
txt=new JTextField();
txt.setBounds(100,10,150,30);
c.add(txt);
pw=new JPasswordField();
pw.setBounds(100,50,150,30);
c.add(pw);
pw1=new JPasswordField();
pw1.setBounds(100,90,150,30);
c.add(pw1);
b1=new JButton("添加");
b1.setBounds(40,170,70,30);
b1.setFont(f);
c.add(b1);
b2=new JButton("取消");
b2.setBounds(170,170,70,30);
b2.setFont(f);
c.add(b2);
b1.addActionListener(this);
b2.addActionListener(this);
this.setTitle("添加管理员");
this.setBounds(300,250,270,250);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.show();
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==b1)
{
Add();
}
if(e.getSource()==b2)
{
int a=JOptionPane.showConfirmDialog(this,"确定要退出吗?","提示信息",JOptionPane.YES_OPTION);
if(a==JOptionPane.YES_OPTION)
dispose();
}
}
public void Add()
{
String s1,s2,s3;
s1=txt.getText();
s2=pw.getText();
s3=String.valueOf(cb.getSelectedItem());
if(s1.length()==0)
{
JOptionPane.showMessageDialog(this,"管理员帐号不能为空!");
return;
}
else if(s2.length()==0)
{
JOptionPane.showMessageDialog(this,"管理员密码不能为空!");
return;
}
else
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}
catch(Exception e){}
try
{
String url="jdbc:odbc:empDSN";
Connection cn=DriverManager.getConnection(url);
String st="insert into managerlist(name,pwd,jb)values(?,?,?)";
PreparedStatement ps=cn.prepareStatement(st);
ps.setString(1,s1);
ps.setString(2,s2);
ps.setString(3,s3);
JOptionPane.showMessageDialog(this,"添加成功!!!");
txt.setText("");
pw.setText("");
pw1.setText("");
ps.executeUpdate();
cn.close();
}
catch(SQLException e){}
}
}
public static void main(String args[])
{
new T111();
}
}
还有JAVA可以在窗体上调用Flash吗?比如说 我把以前做的菜单项和按钮全部换成用Flash做的菜单 需要用到什么语句?