資源簡介
Java編寫的航空訂票系統,應用性強。 Java編寫的航空訂票系統,應用性強。
代碼片段和文件信息
package?flight.query;
import?flight.assist.*;
import?java.awt.*;
import?java.awt.event.*;
import?javax.swing.*;
import?javax.swing.event.*;
import?java.sql.*;
public?class?AirFirmQuery?extends?JPanel?implements?ActionListener
{
???//A?bean?used?to?connect?to?the?database?and?execute?SQL?operation
static?SqlBean?sqlBean?=?new?SqlBean();
???
private?static?DefaultComboBoxModel?model?=?new?DefaultComboBoxModel();
private?static?JComboBox?jcb?=?new?JComboBox(model);
???//Used?to?store?the?item?you?choosed?inth?combobox
private?String?airfirm;
private?JButton?jbQuery?=?new?JButton(“查詢“);
???//Setup?GUI?in?the?Constructor?method
public?AirFirmQuery()
{
???????//*****************************************************
???????
JLabel?jl?=?new?JLabel(“??航空公司查詢“);
????jl.setFont(new?Font(“Times“Font.BOLD23));
????JPanel?jpTop?=?new?JPanel();
????jpTop.add(jl);????
???
????JLabel?jl2?=?new?JLabel(“????????請輸入航班名稱或者本查詢將“);
????jl2.setHorizontalAlignment(JLabel.CENTER);
????jl2.setFont(new?Font(“Times“Font.PLAIN12));
????
????JLabel?jl3?=?new?JLabel(“提供你該航空公司所有的航班情況:“);
????jl3.setHorizontalAlignment(JLabel.CENTER);
????jl3.setFont(new?Font(“Times“Font.PLAIN12));
????JPanel?jpLabel?=?new?JPanel(new?BorderLayout());
????jpLabel.add(jl2BorderLayout.NORTH);
????jpLabel.add(jl3BorderLayout.CENTER);
????
???????//******************************************************
????
????JPanel?jpBox?=?new?JPanel();
????jpBox.add(jcb);
????
????JPanel?jpButton?=?new?JPanel();
????jpButton.add(jbQuery);
????
????JPanel?jp?=?new?JPanel();
????jp.add(jpBox);
????jp.add(jpButton);
????
???????//*****************************************************
????
????JPanel?jpCenter?=?new?JPanel();
????jpCenter.setLayout(new?BorderLayout());
????jpCenter.add(jpLabelBorderLayout.NORTH);
????jpCenter.add(jpBorderLayout.CENTER);
????
????JPanel?jpQuery?=?new?JPanel();
????jpQuery.setLayout(new?BorderLayout());
????jpQuery.add(jpTopBorderLayout.NORTH);
????jpQuery.add(jpCenterBorderLayout.CENTER); ??
????
????this.setLayout(new?BorderLayout());
????this.add(new?JLabel(“????????“)BorderLayout.NORTH);
????this.add(jpQueryBorderLayout.CENTER); ??
????
???????//Add?listener?to?the?query?button
????jbQuery.addActionListener(this);
}
public?static?void?updateAirFirmComboBox(String?newPlaceint?insertOrDelete)
{
if?(insertOrDelete?==?1)
{
if?(model.getIndexOf(newPlace)?==?-1)
???jcb.addItem(newPlace);
}
???
else?if?(insertOrDelete?==?2)
{
if?(model.getIndexOf(newPlace)?!=?-1)
???jcb.removeItem(newPlace);
}
???
}
public?void?actionPerformed(ActionEvent?e)
{
this.airfirm?=?(String)jcb.getSelectedItem();
???//Do?the?query?work
executeAirFirmQuery();
}
public?void?executeAirFirmQuery()
{
???//Form?the?sqlString
String?sqlString?=?“SELECT?DISTINCT?*?FROM?“?+
??
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????6250??2004-12-30?02:40??完美版\AirFirmQuery.java
?????文件??????13615??2004-12-30?14:42??完美版\CommonQuery.java
?????文件??????35049??2004-12-30?14:13??完美版\ComprehenQuery.java
?????文件???????8002??2004-12-30?16:46??完美版\DeletePanel.java
?????文件???????9459??2004-12-30?02:40??完美版\DestinQuery.java
?????文件????????232??2004-12-29?14:45??完美版\f.gif
?????文件???????7316??2004-12-30?02:40??完美版\FlightQuery.java
?????文件???????7280??2004-12-30?16:46??完美版\InsertPanel.java
?????文件?????160985??2004-12-29?15:17??完美版\jiemian.gif
?????文件???????1873??2004-12-30?14:35??完美版\MyQuery.java
?????文件???????6051??2004-12-30?04:09??完美版\SeatInfo.java
?????文件???????1900??2004-12-29?02:30??完美版\SqlBean.java
?????文件????????930??2004-12-29?16:38??完美版\TestDB.java
?????文件??????23052??2004-12-30?15:38??完美版\TuiPiao.java
?????文件???????4623??2004-12-30?14:31??完美版\UpdateComboBox.java
?????文件???????7236??2004-12-30?16:46??完美版\UpdatePanel.java
?????文件????????765??2004-12-30?13:56??完美版\writeToFile.java
?????文件???????2705??2004-12-30?14:57??完美版\Show.java
?????文件??????13775??2004-12-30?15:33??完美版\Client.java
?????文件???????2970??2004-12-30?15:34??完美版\CheckID.java
?????文件????????857??2004-12-30?15:37??完美版\Main.java
?????文件??????23207??2004-12-30?16:39??完美版\Hangkong.java
?????文件??????25138??2004-12-30?17:14??完美版\72341.gif
?????文件???????3225??2004-12-30?17:40??完美版\Interface.java
?????文件???????6250??2004-12-30?02:40??完美版\源代碼\AirFirmQuery.java
?????文件??????13228??2004-12-30?05:04??完美版\源代碼\Client.java
?????文件??????12878??2004-12-30?12:47??完美版\源代碼\CommonQuery.java
?????文件??????35026??2004-12-30?02:39??完美版\源代碼\ComprehenQuery.java
?????文件???????7542??2004-12-30?03:32??完美版\源代碼\DeletePanel.java
?????文件???????9459??2004-12-30?02:40??完美版\源代碼\DestinQuery.java
............此處省略24個文件信息
- 上一篇:八數碼java和報告
- 下一篇:Java版航空訂票系統源碼
評論
共有 條評論