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

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

?? comprehenquery.java

?? 一個簡單的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| 色网站国产精品| 奇米一区二区三区av| 亚洲少妇中出一区| 亚洲男帅同性gay1069| 国产精品美女久久久久久久久久久 | 中文字幕一区二区三区视频| 国产三级一区二区| 亚洲国产精品99久久久久久久久| 久久这里只有精品6| 国产亚洲精品精华液| 中文字幕人成不卡一区| 亚洲精品视频一区| 亚洲成av人片| 久久99久久99精品免视看婷婷| 韩国女主播一区| 成人h动漫精品| 色哟哟国产精品| 欧美老年两性高潮| 欧美一区二区三区成人| 久久久久国产精品麻豆ai换脸 | 91极品美女在线| 欧美午夜精品久久久久久超碰| 欧美最猛性xxxxx直播| 欧美人动与zoxxxx乱| 欧美肥妇bbw| 久久久精品中文字幕麻豆发布| 亚洲视频免费在线观看| 奇米精品一区二区三区在线观看一 | 欧美日本一区二区三区| 精品免费视频一区二区| 亚洲精品国产a久久久久久| 老司机精品视频在线| jlzzjlzz欧美大全| 在线成人午夜影院| 国产精品久久久一区麻豆最新章节| 亚洲国产精品一区二区www在线 | 欧美视频自拍偷拍| 久久青草欧美一区二区三区| 亚洲精品老司机| 九九久久精品视频| 一本一道久久a久久精品综合蜜臀| 欧美一二三区在线观看| 国产精品久久久久久妇女6080| 日日噜噜夜夜狠狠视频欧美人 | 91精品国产综合久久国产大片| 欧美激情综合在线| 免费观看日韩av| 欧美三级韩国三级日本三斤| 国产精品高潮久久久久无| 免费成人在线播放| 在线观看日韩国产| 日韩伦理电影网| 国产精品69毛片高清亚洲| 欧美四级电影网| 亚洲欧美日韩电影| 成人黄色av网站在线| 精品99999| 三级不卡在线观看| 欧美日韩黄色影视| 亚洲精品日产精品乱码不卡| 成人午夜精品一区二区三区| 亚洲精品一区二区三区影院| 日韩高清一区在线| 欧美精品视频www在线观看| 日韩理论片在线| 粉嫩aⅴ一区二区三区四区| 久久蜜桃av一区二区天堂 | 亚洲少妇30p| 国产999精品久久久久久绿帽| 欧美一级在线视频| 日本不卡一二三| 欧美久久久久久久久中文字幕| 亚洲猫色日本管| 色婷婷av一区| 亚洲国产人成综合网站| 欧美又粗又大又爽| 一区二区三区不卡在线观看| 日本韩国欧美国产| 一区二区三区日韩在线观看| 色哟哟亚洲精品| 香蕉成人啪国产精品视频综合网| 欧美影视一区在线| 日韩av网站在线观看| 91精品国产91热久久久做人人| 天天色图综合网| 欧美一区二区三区电影| 国产在线视频一区二区| 欧美韩国一区二区| 99精品视频一区| 亚洲国产日韩a在线播放| 欧美电影在哪看比较好| 激情深爱一区二区| 国产午夜三级一区二区三| www.欧美.com| 亚洲一区二三区| 日韩欧美一区二区免费| 国产在线不卡一区| 亚洲人成在线播放网站岛国| 欧美色综合网站| 久久99精品久久久久婷婷| 国产欧美一区二区精品性色| 色欧美88888久久久久久影院| 亚洲一线二线三线视频| 久久久九九九九| 欧美色综合网站| 国产一区二区网址| 亚洲一区二区三区视频在线播放| 91麻豆精品国产91久久久久久久久| 午夜精品一区在线观看| 久久精品夜色噜噜亚洲aⅴ| 91色porny| 青娱乐精品视频在线| 日本一区二区免费在线| 欧美在线看片a免费观看| 精品一区二区三区的国产在线播放| 国产欧美日韩精品a在线观看| 色欧美片视频在线观看| 国产成人在线影院| 天天色图综合网| 中文幕一区二区三区久久蜜桃| 欧美三级中文字幕在线观看| 极品美女销魂一区二区三区| 亚洲国产精品一区二区www| 日本一区二区三区四区| 欧美一区二区精品在线| 在线视频亚洲一区| 国产成都精品91一区二区三| 天天色综合成人网| 亚洲综合成人在线| 国产日韩欧美精品综合| 在线成人av影院| 在线视频国内一区二区| 国产suv精品一区二区三区| 丝袜美腿高跟呻吟高潮一区| 中文字幕五月欧美| 国产日韩欧美亚洲| 欧美xxxx在线观看| 91精品国产综合久久福利| 欧美色爱综合网| 91老师片黄在线观看| 成人av综合一区| 国产一本一道久久香蕉| 麻豆91精品视频| 日本aⅴ亚洲精品中文乱码| 亚洲午夜一区二区三区| 18成人在线视频| 中文字幕一区免费在线观看| 久久蜜臀精品av| 久久婷婷成人综合色| 精品国产三级电影在线观看| 欧美一级xxx| 91麻豆精品国产91久久久久久久久 | 国产日韩精品视频一区| 精品国产一区久久| 久久久久久亚洲综合影院红桃| 日韩手机在线导航| 精品久久免费看| 日韩久久免费av| 精品成a人在线观看| 久久精品视频在线看| 精品国产欧美一区二区| 精品国产在天天线2019| 久久九九久精品国产免费直播| 久久欧美一区二区| 国产精品视频第一区| 国产精品美女久久久久久久 | 久久久久久久久久看片| 久久久久久久久久久电影| 久久久久久久精| 国产精品天天摸av网| 亚洲欧美激情小说另类| 亚洲自拍另类综合| 蜜臀久久久99精品久久久久久| 久久超碰97人人做人人爱| 国产成人精品一区二区三区四区 | 国产精品99久久不卡二区| 成人av网站大全| 欧美日韩精品欧美日韩精品一综合| 欧美日韩色综合| 久久女同性恋中文字幕| 亚洲精品成人在线| 裸体在线国模精品偷拍| 成人av一区二区三区| 在线观看不卡视频| 久久综合色一综合色88| 国产精品国产三级国产aⅴ无密码| 一区二区三区日本| 九九视频精品免费| 色综合久久久久| 337p日本欧洲亚洲大胆精品| 中文字幕一区二| 蜜桃av一区二区在线观看| 精品写真视频在线观看| 91丨porny丨首页| 精品久久国产97色综合| 一区二区三区在线不卡| 国产麻豆午夜三级精品| 欧美一区二区黄| 一区二区三区在线观看视频|