import class LogOn { public static void main(String[] args)throws SQLException { final JFrame jfrmlogin=new JFrame(\系统登录\ (400,280); Dimension screenSize=().getScreenSize(); ((int) /2,(int)/2);etLayout(new GridLayout(3,1)); ().add(p1); ().add(p2); ().add(p3); (true); } }
import .*;
public class ConnectOracle{
public static void connection(String[] args) throws SQLException {
.....\); (\);
/*conn =*/ (\,
\, \);
\已经连接到数据库.....\);
;
import .*;
public class AdminInquireTicket extends JFrame { Connection con; Statement st;
private JScrollPane scpDemo; private JTableHeader jth; private JTable tabDemo; private JButton btnShow; private JButton btnShow1;
public AdminInquireTicket() {
super(\华清池售票系统\ (430,400); (null); (500,180);
= new JScrollPane();
= new JButton(\显示票信息\ = new JButton(\返 回\
JLabel jLabel1=new JLabel(\余票总数:\ JTextField jTextField1=new JTextField(); (new Rectangle(20,330,100,30)); (new Rectangle(90,330,70,30));
add; add; add;
(jLabel1); (jTextField1); (true); try{
(\
con = (\ ResultSet rs=null; int n = 0; st=();
rs = (\ while()) {
n++; }
(\
}catch(Exception exception){ (); }
ActionListener() {
public void actionPerformed(ActionEvent e) { MainFrame mu=new MainFrame(); (true); dispose(); } });
ActionListener() {
public void actionPerformed(ActionEvent ae) {
btnShow_ActionPerformed(ae); } });
}
public void btnShow_ActionPerformed(ActionEvent ae) {
try{ (\
Connection con = (\\
String sql = \ PreparedStatement pstm = (sql); ResultSet rs = ();
int count = 0; while()) {
count++; }
rs = ();
Object[][] info = new Object[count][4]; count = 0; while()) {
info[count][0] = (\ info[count][1] = (\ info[count][2] = (\ count++; }
String[] title = {\票号\日期\票价\ = new JTable(info,title); =
}catch(ClassNotFoundException cnfe){ (null,\查询失败!\错误\ }catch(SQLException sqle){
(null,\查询失败!\错误\ } } }
import class BuyTicket extends JPanel implements ActionListener { Connection con; Statement st; 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(\确定购买\ public BuyTicket() { try{ jbInit(); } catch(Exception exception){ (); } }
private void jbInit() throws Exception { (\
con = (\ (null); (new Rectangle(40,40,64,24)); (new Rectangle(40,100,53,22)); (new Rectangle(40,160,61,27)); (new Rectangle(40,220,61,27)); (new Rectangle(102,40,200,30)); (new Rectangle(102,100,200,30)); (new Rectangle(102,160,200,33)); (new Rectangle(102,220,200,33)); (new Rectangle(120,300,150,32)); (this);
(jLabel1); (jTextField1); (jLabel2); (jTextField2); (jLabel3); (jTextField3); (jLabel4);
(jTextField4); (jButton1);
ResultSet rs=null; st=();