亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? comprehenquery.java

?? 歡迎使用航空訂售票系統 還有很多不足之處望大家諒解
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
package flight.query;

import flight.assist.*;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;
import java.sql.*;

public class ComprehenQuery extends JPanel implements ActionListener,ItemListener
{
	   //A bean used to connect to the database and execute SQL operation
	static SqlBean sqlBean = new SqlBean();
	
	   //*********************************************************************
	   //Model for the place combobox
    private static DefaultComboBoxModel modelPlace = new DefaultComboBoxModel();   
       //Model for the airfirm combobox
    private static DefaultComboBoxModel modelAirFirm = new DefaultComboBoxModel();
       //Items for the year combobox
    private static Object[] year = {"2004","2005"};
       //Items for the month combobox
 	private static Object[] month = {"1","2","3","4","5","6","7","8","9","10","11","12"};
 	   //Items for the day combobox
 	private static Object[] day = {"1","2","3","4","5","6","7","8","9","10","11","12",
 	                               "13","14","15","16","17","18","19","20","21","22",
 	                               "23","24","25","26","27","28","29","30","31"}; 	                        
 	                         	
 	private  static JComboBox jcbStart = new JComboBox(),jcbFirstArrive = new JComboBox(),
 	                          jcbArrive = new JComboBox(),jcbAirFirm = new JComboBox(modelAirFirm),
 	                          jcbYear1 = new JComboBox(year),jcbYear2 = new JComboBox(year),
 	                          jcbMonth2 = new JComboBox(month),jcbMonth1 = new JComboBox(month),
 	                          jcbDay1 = new JComboBox(day),jcbDay2 = new JComboBox(day);
 	   //*********************************************************************
 	                   
 	private JRadioButton jrbSingle = new JRadioButton("單程",true),
 	                     jrbDouble = new JRadioButton("往返",false),
 	                     jrbMutiple = new JRadioButton("聯程",false);
 	   
 	   //The program should change the content in the label dynamically,
 	   //so we should put the JLabels as the menber varibles 
 	   //so that we can change their contents in every method of this class
 	private JLabel jlStart,jlFirstArrive,jlArrive,
 	               jlTime1,jlTime2,jlAirFirm,
 	               jlReplaceArrive,jlReplaceTime;
 	                   
       //The program should remove and add components into the framework dynamically
       //according to the query mode you have selected!
       //So we should put the JPanels as the menber varibles 
 	   //so that we can remove and add components in the panels in every method of this class
    private JPanel jpFirstArriveBox,jpTime2Box,jpReplaceArrive,jpArrive1,jpReplaceTime,jpTime2; 
       
    private JButton jbQuery = new JButton("查詢");
    
       //Used to the items choosed from each combobox
    private String start,firstArrive,arrive,leaveWeek,leaveWeek2,backWeek,airFirm,
                   leaveYear,leaveMonth,leaveDay,backYear,backMonth,backDay,
                   leaveYear2,leaveMonth2,leaveDay2;
      
       //Setup GUI in the Constructor method
    public ComprehenQuery()
    {   
        jcbAirFirm.addItem("所有");
        jcbAirFirm.setSelectedItem("所有");
    
           //Make the time combobox show the present time when you first the program 	
    	setDisplayPresentTime();
    	
    	   //*********************************************************************
    	
    	JPanel jp1 = new JPanel();
    	jp1.add(jrbSingle);
    	JPanel jp2 = new JPanel();
    	jp2.add(jrbDouble);
    	JPanel jp3 = new JPanel();
    	jp3.add(jrbMutiple);    	
    	
    	JPanel jpRadioButton = new JPanel();
    	jpRadioButton.setLayout(new GridLayout(5,1)); 
    	jpRadioButton.add(new JLabel("       "));   	
    	jpRadioButton.add(jp1);
    	jpRadioButton.add(jp2);
    	jpRadioButton.add(jp3);
    	jpRadioButton.add(new JLabel("       "));
    	
    	ButtonGroup bg = new ButtonGroup();
    	bg.add(jrbSingle);
    	bg.add(jrbDouble);
    	bg.add(jrbMutiple);
    	
    	   //*********************************************************************
    	
    	JPanel jpStart = new JPanel(new FlowLayout(FlowLayout.RIGHT));
    	jpStart.add(jlStart = new JLabel("        出發城市:"));
    	
    	JPanel jpFirstArrive = new JPanel(new FlowLayout(FlowLayout.RIGHT));
    	jpFirstArrive.add(jlFirstArrive = new JLabel("                "));
    	
    	JPanel jpArrive = new JPanel(new FlowLayout(FlowLayout.RIGHT));
    	jpArrive.add(jlArrive = new JLabel("        到達城市:"));
    	
    	JPanel jpTime1Tip = new JPanel(new FlowLayout(FlowLayout.RIGHT));
    	jpTime1Tip.add(jlTime1 = new JLabel("        出發日期:"));
    	
    	JPanel jpTime2Tip = new JPanel(new FlowLayout(FlowLayout.RIGHT));
    	jpTime2Tip.add(jlTime2 = new JLabel("              "));
    	
    	JPanel jpAirFirm = new JPanel(new FlowLayout(FlowLayout.RIGHT));
    	jpAirFirm.add(jlAirFirm = new JLabel("       航空公司:"));
    	
    	JPanel jpLabels = new JPanel();
    	jpLabels.setLayout(new GridLayout(7,1));    	
    	jpLabels.add(jpStart);
    	jpLabels.add(jpFirstArrive);
    	jpLabels.add(jpArrive);
    	jpLabels.add(jpTime1Tip);
    	jpLabels.add(jpTime2Tip);
    	jpLabels.add(jpAirFirm);
    	jpLabels.add(new JLabel("            "));
    	
    	   //*********************************************************************
    	            
        JPanel jpStartBox = new JPanel(new FlowLayout(FlowLayout.LEFT));
        jpStartBox.add(jcbStart);
        
           //***********************
           //The combobox "jcbFirstArrive" should be removed from and added into the 
           //jpFirstArriveBox dynamically,
           //so create a panel contains an empty label that used to replace 
           //the panel that contains the combobox "jcbFirstArrive" when we don't need it
        jpReplaceArrive = new JPanel(new FlowLayout(FlowLayout.LEFT));
    	jpReplaceArrive.add(jlReplaceArrive = new JLabel("            "));
    	
    	jpArrive1 = new JPanel(new FlowLayout(FlowLayout.LEFT));
    	jpArrive1.add(jcbFirstArrive);
    	
        jpFirstArriveBox = new JPanel(new FlowLayout(FlowLayout.LEFT,0,0));
    	jpFirstArriveBox.add(jpReplaceArrive);
    	   //***********************    	   
    	  
    	JPanel jpArriveBox = new JPanel(new FlowLayout(FlowLayout.LEFT));
    	jpArriveBox.add(jcbArrive);
    	
    	JPanel jpTime1Box = new JPanel(new FlowLayout(FlowLayout.LEFT));
    	jpTime1Box.add(jcbYear1);
    	jpTime1Box.add(jcbMonth1);
    	jpTime1Box.add(jcbDay1);
    	
    	   //***********************
    	   //The comboboxes "jcbYear2,jcbMonth2,jcbDay2" should be removed from 
    	   //and added into the jpTime2Box dynamically,
    	   //so create a panel contains an empty label that used to replace
           //the panel that contains the comboboxes "jcbYear2,jcbMonth2,jcbDay2"
    	jpReplaceTime = new JPanel(new FlowLayout(FlowLayout.LEFT));
    	jpReplaceTime.add(jlReplaceTime = new JLabel("            ")); 
    	
    	jpTime2 = new JPanel(new FlowLayout(FlowLayout.LEFT));
    	jpTime2.add(jcbYear2);
    	jpTime2.add(jcbMonth2);
    	jpTime2.add(jcbDay2);
    	
    	jpTime2Box = new JPanel(new FlowLayout(FlowLayout.LEFT,0,0));
    	jpTime2Box.add(jpReplaceTime); 
    	  	//***********************    	  	 	
    	    
    	JPanel jpAirFirmBox = new JPanel(new FlowLayout(FlowLayout.LEFT));
    	jpAirFirmBox.add(jcbAirFirm);
    	
    	JPanel jpButton = new JPanel(new FlowLayout(FlowLayout.LEFT));
    	jpButton.add(jbQuery);
    	
    	JPanel jpComboBox = new JPanel();
    	jpComboBox.setLayout(new GridLayout(7,1));    
    	jpComboBox.add(jpStartBox);
    	jpComboBox.add(jpFirstArriveBox);
    	jpComboBox.add(jpArriveBox);
    	jpComboBox.add(jpTime1Box);
    	jpComboBox.add(jpTime2Box);
    	jpComboBox.add(jpAirFirmBox);
    	jpComboBox.add(jpButton);
    	
    	    //*********************************************************************
        
        JPanel jpQuery = new JPanel();
        jpQuery.setLayout(new BorderLayout());
        jpQuery.add(jpLabels,BorderLayout.WEST);
        jpQuery.add(jpComboBox,BorderLayout.CENTER);
        
        JPanel jpDown = new JPanel();
        jpDown.setLayout(new BorderLayout());
        jpDown.add(jpRadioButton,BorderLayout.WEST);
        jpDown.add(jpQuery,BorderLayout.CENTER);
        
        JLabel jlTitle = new JLabel("綜合查詢");
        jlTitle.setHorizontalAlignment(JLabel.CENTER);
        jlTitle.setFont(new Font("Tims",Font.BOLD,23));
        this.setLayout(new BorderLayout());
        this.add(jlTitle,BorderLayout.NORTH);
        this.add(jpDown,BorderLayout.CENTER);;
        
           //Add listener to the radio buttons 
           //RadioListener is an inner class which define below
        jrbSingle.addActionListener(new RadioListener());
        jrbDouble.addActionListener(new RadioListener());
        jrbMutiple.addActionListener(new RadioListener());
        
           //Add listener to the time comboboxes
        jcbYear1.addItemListener(this);
        jcbYear2.addItemListener(this);
        jcbMonth1.addItemListener(this);
        jcbMonth2.addItemListener(this);
        
           //Add listener to the query button
        jbQuery.addActionListener(this);    	
    }
    
    public static void updatePlaceComboBox(String newPlace,int insertOrDelete)
    {
    	if (insertOrDelete == 1)
    	{
    		if (modelPlace.getIndexOf(newPlace) == -1)
    		{
	    		modelPlace.addElement(newPlace);
	    		jcbStart.addItem(newPlace);	
	    		jcbFirstArrive.addItem(newPlace);	
	    		jcbArrive.addItem(newPlace);	
    		}
	    	
    	}
    	else if (insertOrDelete == 2)
    	{
    		if (modelPlace.getIndexOf(newPlace) != -1)
    		{
	    		modelPlace.removeElement(newPlace);
	    		jcbStart.removeItem(newPlace);
	    		jcbFirstArrive.removeItem(newPlace);
	    		jcbArrive.removeItem(newPlace);	
    		}    		
    	}   	
    }
    
    public static void updateAirFirmComboBox(String newAirFirm,int insertOrDelete)
    {
    	if (insertOrDelete == 1)
    	{
    		if (modelAirFirm.getIndexOf(newAirFirm) == -1)
    		   jcbAirFirm.addItem(newAirFirm);
    	}
    	   
    	else if (insertOrDelete == 2)
    	{
    		if (modelAirFirm.getIndexOf(newAirFirm) != -1)
	    	   jcbAirFirm.removeItem(newAirFirm);
    	}
    	   
    }
    
       //The method that makes the time combobox show the present time
       //when you first the program 
    public void setDisplayPresentTime()
    {
    	   //Get the instance for the class Calendar which used to get the present time
    	Calendar cal = Calendar.getInstance();
    	
    	   //Because there are two Date classes(java.util.Date--java.sql.Date)
    	   //So we should designate the full name for the java.util.Date class 
    	cal.setTime(new java.util.Date());
    	
    	   //Get the present year,month,day
    	String year = String.valueOf(cal.get(Calendar.YEAR));
    	String month = String.valueOf(cal.get(Calendar.MONTH) + 1);
    	String day = String.valueOf(cal.get(Calendar.DAY_OF_MONTH));
    	
    	   //Make the time combobox show the present time
    	jcbYear1.setSelectedItem(year);
    	jcbYear2.setSelectedItem(year);
    	jcbMonth1.setSelectedItem(month);
    	jcbMonth2.setSelectedItem(month);
    	
    	   //We should change the items in the day combobox dynamically
    	   //according to the year and month
    	updateDay(year,month,jcbDay1);
    	updateDay(year,month,jcbDay2);    	
    	
    	jcbDay1.setSelectedItem(day);
    	jcbDay2.setSelectedItem(day);    	
    }
    
       //The method which used to change the items in the day combobox dynamically
       //according to the year and month
    private void updateDay(String year,String month,JComboBox jcb)
    {
    	   //There are 30 days in the months 4,6,9,11
    	if (month.equals("4") || month.equals("6") || month.equals("9") || month.equals("11"))    	   
    	{
    		   //jcb.getItemCount() == 31 means that there are 31 days in the day combobox,
    		   //but exactly it is 30 days,so we should remove the 31st day from the day combobox
    		if (jcb.getItemCount() == 31)
    		   jcb.removeItem("31");	
    		else if(jcb.getItemCount() == 29)    		
    		   jcb.addItem("30");    	
    		else if (jcb.getItemCount() == 28)
    		{
    			jcb.addItem("29");
    			jcb.addItem("30");
    		}    	
    	}
    	   //There are 28 or 29 days in the month 2
    	else if (month.equals("2"))
    	{
    		int years = Integer.parseInt(year);
    		
    		   //The year is leap year
    		if ( (years % 400 == 0) || (years %4 == 0 && years % 100 != 0))
    		{
    			if (jcb.getItemCount() == 31)
    			{
    				jcb.removeItem("30");
    			    jcb.removeItem("31");    		    			
    			}
    			else if (jcb.getItemCount() == 30)
    			{

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩国产精品自在自线| 亚洲精品国久久99热| 国产欧美日本一区二区三区| 中文字幕一区二区三区精华液| 亚洲成人自拍一区| 成人久久18免费网站麻豆| 欧美丰满少妇xxxxx高潮对白| 欧美激情综合网| 久久国产欧美日韩精品| 91成人国产精品| 国产片一区二区| 久久成人麻豆午夜电影| 欧美日韩成人一区二区| 亚洲综合一二三区| av亚洲产国偷v产偷v自拍| 欧美精品一区二区三区很污很色的| 一级特黄大欧美久久久| fc2成人免费人成在线观看播放| 欧美成人欧美edvon| 视频一区二区国产| 欧美日韩电影在线| 亚洲一区在线视频观看| 色综合中文字幕| 国产精品对白交换视频| 国产成人精品免费| 久久亚区不卡日本| 国产真实乱子伦精品视频| 日韩一级二级三级精品视频| 日日摸夜夜添夜夜添国产精品 | 亚洲精品视频在线观看免费| 国产传媒久久文化传媒| 久久久美女毛片| 国产一区二区0| 国产色一区二区| 国产99久久久久久免费看农村| 久久综合五月天婷婷伊人| 久久99国产精品久久99| 欧美va亚洲va在线观看蝴蝶网| 蜜臀av性久久久久av蜜臀妖精| 欧美大片在线观看一区二区| 久久99精品久久只有精品| 日韩精品一区二区三区老鸭窝| 狠狠色丁香婷婷综合久久片| 欧美精品一区二区蜜臀亚洲| 国内精品自线一区二区三区视频| 精品久久一区二区三区| 国产传媒一区在线| 亚洲欧美一区二区三区国产精品| 色婷婷综合激情| 天使萌一区二区三区免费观看| 4438成人网| 国产成人免费在线视频| 成人免费一区二区三区在线观看| 色婷婷av一区二区三区之一色屋| 一区二区三区在线视频免费| 欧美精品自拍偷拍| 国产老肥熟一区二区三区| 国产精品卡一卡二| 欧美综合在线视频| 国产一区二区精品久久99| 国产精品女人毛片| 在线视频你懂得一区| 久久av中文字幕片| 中文字幕一区在线| 欧美一级片在线| 成人涩涩免费视频| 天天av天天翘天天综合网色鬼国产| 精品久久人人做人人爰| 91在线国产观看| 免费久久精品视频| 亚洲图片欧美激情| 精品国产伦一区二区三区免费| av影院午夜一区| 韩国女主播成人在线| 亚洲免费观看在线视频| 精品久久久久久久一区二区蜜臀| jvid福利写真一区二区三区| 老司机精品视频导航| 亚洲欧美激情在线| 久久综合丝袜日本网| 欧美色区777第一页| 成人一区二区三区| 日本美女一区二区三区视频| 国产精品灌醉下药二区| 欧美不卡一区二区| 欧美日韩国产大片| 色美美综合视频| 国产成+人+日韩+欧美+亚洲| 日韩精品色哟哟| 一区二区三区不卡视频| 中国色在线观看另类| 欧美tickle裸体挠脚心vk| 欧美亚洲国产一区二区三区va | 精品少妇一区二区三区视频免付费| 91网页版在线| 懂色av中文一区二区三区| 日本欧美加勒比视频| 五月天久久比比资源色| 亚洲免费电影在线| 亚洲欧洲一区二区在线播放| 国产日韩欧美麻豆| 久久一二三国产| 久久综合久久综合九色| 日韩精品在线一区| 日韩一区二区三区在线视频| 欧美精品一卡两卡| 欧美日韩亚洲综合在线| 在线观看欧美日本| 91成人免费在线视频| 色综合视频在线观看| 色婷婷av一区| 欧美色区777第一页| 欧美日韩日日夜夜| 欧美日韩电影在线播放| 88在线观看91蜜桃国自产| 欧美人体做爰大胆视频| 欧美日韩国产综合一区二区 | 久久精品水蜜桃av综合天堂| 欧美不卡一区二区| 久久久青草青青国产亚洲免观| 久久网这里都是精品| 久久精品视频一区二区三区| 国产日产亚洲精品系列| 国产精品传媒入口麻豆| 综合激情成人伊人| 亚洲午夜在线视频| 午夜精品久久一牛影视| 蜜臀va亚洲va欧美va天堂 | 91麻豆国产福利在线观看| 91在线看国产| 在线播放亚洲一区| 精品嫩草影院久久| 欧美激情在线一区二区三区| 中文字幕一区在线观看视频| 一区二区三区免费看视频| 日韩中文字幕麻豆| 黄一区二区三区| 92国产精品观看| 在线播放国产精品二区一二区四区| 91精品欧美福利在线观看| 91精品免费观看| 国产亚洲欧洲一区高清在线观看| 中文字幕免费不卡在线| 亚洲综合清纯丝袜自拍| 麻豆精品蜜桃视频网站| 国产成+人+日韩+欧美+亚洲| 欧美天堂亚洲电影院在线播放| 8v天堂国产在线一区二区| 国产欧美日产一区| 视频一区视频二区中文字幕| 国产一区二区三区香蕉| 99re这里只有精品首页| 欧美一区二区三区爱爱| 国产精品国产三级国产普通话三级| 亚洲一区二区三区视频在线播放| 蜜桃视频在线观看一区| 91欧美一区二区| 欧美不卡一区二区三区四区| 亚洲视频一二区| 美女网站一区二区| 色94色欧美sute亚洲线路一ni| 欧美哺乳videos| 亚洲一区在线观看视频| 国产九九视频一区二区三区| 欧美日韩国产影片| 国产精品久久久久久久久免费丝袜| 丝袜美腿亚洲综合| jiyouzz国产精品久久| 精品少妇一区二区三区免费观看 | 中文字幕精品一区| 免费国产亚洲视频| 日本高清不卡aⅴ免费网站| 久久这里只有精品6| 亚洲午夜av在线| 91免费版在线看| 欧美国产一区二区| 欧美a一区二区| 欧美影院精品一区| 亚洲免费在线视频| 99精品视频一区二区三区| 精品99999| 免费人成在线不卡| 欧美一区二区三区日韩视频| 伊人一区二区三区| 91麻豆高清视频| 亚洲私人影院在线观看| 丰满放荡岳乱妇91ww| 久久久亚洲精华液精华液精华液| 日韩电影网1区2区| 欧美久久一二区| 亚洲国产成人va在线观看天堂| 色综合欧美在线| 亚洲人被黑人高潮完整版| av毛片久久久久**hd| 中文字幕不卡在线观看| 大胆亚洲人体视频| 久久嫩草精品久久久久| 国产乱码精品一区二区三区av| 久久午夜羞羞影院免费观看| 精品亚洲porn|