clientframe.java~539~

来自「济南公交管理系统 (不完善,没有解决循环线路问题)」· JAVA~539~ 代码 · 共 1,302 行 · 第 1/4 页

JAVA~539~
1,302
字号

    jScrollPane2.setForeground(Color.blue);
    jScrollPane2.setBorder(BorderFactory.createLineBorder(Color.black));
    jScrollPane2.setBounds(new Rectangle(2, 86, 285, 219));
    jScrollPane2.getViewport().add(jTextArea2, null);

    jPanel4.setLayout(null);
    jPanel4.setBackground(SystemColor.inactiveCaptionText);
    jPanel4.add(jLabel2, null);
    jPanel4.add(jScrollPane2, null);
    jPanel4.add(jTextField4, null);
    jPanel4.add(jButton2, null);
    jPanel4.add(jLabel16, null);
    jPanel4.add(jLabel17, null);
    /**********************************************************/
    /**********************************************************/

    /**********************************************************/
    /******************乘车方案查询面板初始化*********************/
    jButton3.setBackground(Color.white);
    jButton3.setBounds(new Rectangle(125, 65, 46, 21));
    jButton3.setFont(new java.awt.Font("Serif", 1, 15));
    jButton3.setBorder(null);
    jButton3.setIcon(button);
    jButton3.addActionListener(new clientFrame_jButton3_actionAdapter(this));

    jLabel3.setBounds(new Rectangle(0, 0, 305, 25));
    jLabel3.setFont(new java.awt.Font("Serif", 3, 15));
    jLabel3.setForeground(SystemColor.activeCaption);
    jLabel3.setBorder(BorderFactory.createLineBorder(Color.black));
    jLabel3.setText("JNBus->乘车查询");

    jLabel18.setBounds(new Rectangle(0, 30, 175, 27));
    ImageIcon huancheng = new ImageIcon("picture/huancheng.jpg");
    jLabel18.setIcon(huancheng);

    jTextArea3.setForeground(SystemColor.activeCaption);
    jTextArea3.setBorder(null);
    jTextArea3.setEditable(false);
    jTextArea3.setBackground(SystemColor.activeCaptionText);

    jScrollPane3.setBorder(BorderFactory.createLineBorder(Color.black));
    jScrollPane3.setBounds(new Rectangle(2, 91, 296, 214));
    jScrollPane3.getViewport().add(jTextArea3, null);

    jComboBox1.setBackground(SystemColor.inactiveCaptionText);
    jComboBox1.setFont(new java.awt.Font("Serif", 0, 12));
    jComboBox1.setForeground(SystemColor.activeCaption);
    jComboBox1.setBorder(BorderFactory.createLineBorder(Color.black));
    jComboBox1.setEditable(true);
    jComboBox1.setBounds(new Rectangle(1, 60, 120, 27));
    jComboBox1.addItemListener(new ItemListener() {
      public void itemStateChanged(ItemEvent event) {

        if (event.getStateChange() == ItemEvent.SELECTED) {
          if (jComboBox1.getSelectedIndex() == -1) {
            String start_station_name = (String) event.getItem(); //得到输入jcomboBox1中的内容
            String sql =
                "select distinct 站点名 from stationinfo where 站点名 like '%" +
                start_station_name + "%'"; //进行模糊查询
            ResultSet rs;
            try {
              jComboBox1.removeAllItems(); //先把jComboBox1中的内容清空
              rs = con.stmt.executeQuery(sql);
              while (rs.next()) {
                String station_name = rs.getString("站点名"); //找到相近站点名
                jComboBox1.addItem(station_name.trim()); //把查询结果加入jcombobox1中
              }
            }
            catch (SQLException e1) {
            }
          }
        }
      }
    });

    jComboBox2.setBackground(SystemColor.inactiveCaptionText);
    jComboBox2.setFont(new java.awt.Font("Serif", 0, 12));
    jComboBox2.setForeground(SystemColor.activeCaption);
    jComboBox2.setBorder(BorderFactory.createLineBorder(Color.black));
    jComboBox2.setEditable(true);
    jComboBox2.setBounds(new Rectangle(175, 60, 120, 27));
    jComboBox2.addItemListener(new ItemListener() {
      public void itemStateChanged(ItemEvent event) {

        if (event.getStateChange() == ItemEvent.SELECTED) {
          if (jComboBox2.getSelectedIndex() == -1) {
            String start_station_name = (String) event.getItem(); //得到输入jcomboBox1中的内容
            String sql =
                "select distinct 站点名 from stationinfo where 站点名 like '%" +
                start_station_name + "%'"; //进行模糊查询
            ResultSet rs;
            try {
              jComboBox2.removeAllItems(); //先把jComboBox1中的内容清空
              rs = con.stmt.executeQuery(sql);
              while (rs.next()) {
                String station_name = rs.getString("站点名"); //找到相近站点名
                jComboBox2.addItem(station_name.trim()); //把查询结果加入jcombobox1中
              }
            }
            catch (SQLException e1) {
            }
          }
        }
      }
    });

    jPanel5.add(jLabel3, null);
    jPanel5.add(jScrollPane3, null);
    jPanel5.add(jLabel18, null);
    jPanel5.add(jComboBox1, null);
    jPanel5.add(jComboBox2, null);
    jPanel5.add(jButton3, null);
    jPanel5.add(jLabel19, null);
    jPanel5.setBackground(SystemColor.inactiveCaptionText);
    /**********************************************************/
    /**********************************************************/

    /**********************************************************/
    /****************搜刮泉城***********************************/
    jLabel20.setBackground(SystemColor.inactiveCaption);
    jLabel20.setFont(new java.awt.Font("Serif", 3, 15));
    jLabel20.setForeground(SystemColor.activeCaption);
    jLabel20.setBorder(BorderFactory.createLineBorder(Color.black));
    jLabel20.setBounds(new Rectangle(0, 0, 305, 25));
    jLabel20.setText("JNBus->泉城搜刮");

    jButton4.setBackground(SystemColor.inactiveCaptionText);
    jButton4.setBounds(new Rectangle(0, 25, 50, 25));
    jButton4.setFont(new java.awt.Font("Serif", 0, 12));
    jButton4.setForeground(Color.red);
    jButton4.setBorder(null);
    jButton4.setHorizontalAlignment(SwingConstants.LEFT);
    jButton4.setText("衣在济南");

    jButton5.setBackground(SystemColor.inactiveCaptionText);
    jButton5.setBounds(new Rectangle(64, 25, 74, 25));
    jButton5.setFont(new java.awt.Font("Serif", 0, 12));
    jButton5.setForeground(Color.red);
    jButton5.setBorder(null);
    jButton5.setHorizontalAlignment(SwingConstants.LEFT);
    jButton5.setText("济南风景名胜");

    jButton6.setBackground(SystemColor.inactiveCaptionText);
    jButton6.setBounds(new Rectangle(152, 25, 74, 25));
    jButton6.setFont(new java.awt.Font("Serif", 0, 12));
    jButton6.setForeground(Color.red);
    jButton6.setBorder(null);
    jButton6.setHorizontalAlignment(SwingConstants.LEFT);
    jButton6.setText("济南书籍市场");

    jButton7.setBackground(SystemColor.inactiveCaptionText);
    jButton7.setBounds(new Rectangle(239, 25, 50, 25));
    jButton7.setFont(new java.awt.Font("Serif", 0, 12));
    jButton7.setForeground(Color.red);
    jButton7.setBorder(null);
    jButton7.setHorizontalAlignment(SwingConstants.LEFT);
    jButton7.setText("济南车站");

    jLabel21.setFont(new java.awt.Font("Serif", 1, 15));
    jLabel21.setText("|");
    jLabel21.setBounds(new Rectangle(54, 26, 4, 22));

    jLabel22.setFont(new java.awt.Font("Serif", 1, 15));
    jLabel22.setText("|");
    jLabel22.setBounds(new Rectangle(140, 26, 4, 22));

    jLabel23.setFont(new java.awt.Font("Serif", 1, 15));
    jLabel23.setText("|");
    jLabel23.setBounds(new Rectangle(227, 26, 4, 22));

    jPanel10.setBounds(new Rectangle(2, 54, 300, 230));
    jPanel10.setLayout(null);
    jPanel11.setBounds(new Rectangle(2, 54, 300, 230));
    jPanel11.setLayout(null);
    jPanel12.setBounds(new Rectangle(2, 54, 300, 230));
    jPanel12.setLayout(null);
    jPanel13.setBounds(new Rectangle(2, 54, 300, 230));
    jPanel13.setLayout(null);
    jScrollPane5.setBounds(new Rectangle(0, 0, 300, 230));
    jScrollPane6.setBounds(new Rectangle(0, 0, 300, 230));
    jScrollPane7.setBounds(new Rectangle(0, 0, 300, 230));
    jScrollPane8.setBounds(new Rectangle(0, 0, 300, 230));

    String quanchenglu="泉城路: 济南的商业街,许多专卖店都汇集在这里.\n   公交线路:1、3、41、K91、K59、K50。\n";
    String renmin=     "人民商城: 号称泉城的\"时尚之都\"云集来自日韩\n   广东上海的各色新潮服饰,时尚前卫,是时髦\n   女性的最爱.\n公交线路:1、3、5、6、18、43、72、101、103、K50、K51、K59、68。\n";
    String shanshi=    "山师东路:期间遍布各色时尚小店,风格趋向于石山\n   运动型,历来是在校大学生理想的购物天堂。\n   公交线路:18、48、75、110、K59。\n";
    String yinzuo=      "泉城广场银座地下商城: 是各类著名服饰品牌在泉城\n   的汇集,价格不菲。\n";
    String luokou=     "洛口服装城: 以批发为主,规模庞大,花样繁多,价\n   位合理,是不喜欢前卫的你理想的购衣去处。\n   公交线路:4、5、30、K50、K53、K57、K58、K68、84、85、111、112、114、K90。\n";
    String dongmen=    "东门小商品市场: 一小商品著称,服饰类价位一般都\n   能接受,需要仔细淘。\n公交线路:11、36、30、37、K98。\n";
    String huanmei=    "环联小商品市场: 离山大老校新校较近,小商品种类较\n   为齐全,位于洪楼西路。 ";
    jTextArea7.append(quanchenglu+"\n"+renmin+"\n"+shanshi+"\n"+yinzuo+"\n"+luokou+"\n"+dongmen+"\n"+huanmei);

    String baotuquan="趵突泉公园: 济南三大名胜之一,被誉为“天下第一泉”。\n   门票15元。\n   5、41、49、K54、K96、85、102、103、104路即可到达。 \n";
    String daminghu= "大明湖: 济南三大名胜之一,“四面荷花三面柳,一城山色\n   半城湖”是大明湖风景最好的写照。\n   门票15元。\n   西南门:K54、K98、11、41、66路; \n   南门:K54 、K98、11、41路; \n   东门:41、31、36、37、83、33、6路; \n   北门:6、30路。 \n";
    String qianfou=  "千佛山: 济南三大名胜之一,香火胜地。\n   门票20元。\n   2、31、48、K51、K568可达。\n";
    String springsq= "泉城广场: 是济南的中心广场,地处山泉\n   河城环保之中,是同学们闲时休憩盘亘之胜地。\n   无门票。\n   5、14、36、K51、K52、K54、K55、K91、K96、104、19、70、72、102、103、80、85可达。\n";
    String zhiwuyuan="植物园: 济南唯一免费开放的植物园占地\n   面积广,植物众多位于经十路106号.\n   2、14、13、16、32、34、43、44、48、63、64、73、85、110、K54、K56、K94、68路公交线路可到达.\n";
    jTextArea8.append(baotuquan+"\n"+daminghu+"\n"+qianfou+"\n"+springsq+"\n"+zhiwuyuan);

    String shanda="山大图书: 山大新校南门斜对面 \n";
    String sanlian="三联书店: 文化东路61——1号\n";
    String shenwaiwen="省外文书店: 泺源大街与朝山街路口东南\n";
    String dongtu="东图书店: 大观园东50米十字路口处\n";
    String quanlib="泉城路书店: 泉城路85号,作家、歌手常在此签售\n";
    String yinxiong="英雄山文化市场: 济南最大的书刊市场,均可达者,位于新世界商城对面。\n   乘75路公交车在新世界商城下车。 ";
    jTextArea9.append(shanda+"\n"+sanlian+"\n"+shenwaiwen+"\n"+dongtu+"\n"+quanlib+"\n"+yinxiong) ;

    String huochezhan="济南火车站: 乘坐11、10、3、43、K51路公交车即可到达。\n";
    String lianyun="联运汽车站: 济南火车站前广场东侧\n";
    String changtu="长途汽车总站: 济洛路、北园大街西首。\n   乘坐12、18、32、45、72、84、85、K50、K92、K95、K108路\n      公交车济南的商业街,许多专卖店都汇集在这里.\n   公交线路:1、3、41、K91、K59、K50。\n";
    jTextArea10.append(huochezhan+"\n"+lianyun+"\n"+changtu);


    /**********************************************************/
    /**********************************************************/

    jTabbedPane1.setEnabled(true);
    jTabbedPane1.setFont(new java.awt.Font("Serif", 1, 15));
    jTabbedPane1.setForeground(Color.black);
    jTabbedPane1.setBorder(BorderFactory.createLineBorder(Color.black));
    jTabbedPane1.setPreferredSize(new Dimension(79, 130));
    jTabbedPane1.setBackground(SystemColor.inactiveCaption);
    jTabbedPane1.setBounds(new Rectangle( -2, 0, 382, 340));
    jTabbedPane1.setTabPlacement(JTabbedPane.LEFT);

    jPanel6.setBackground(SystemColor.inactiveCaptionText);
    jPanel7.setBackground(SystemColor.inactiveCaptionText);

    jLabel4.setBounds(new Rectangle(0, 0, 305, 25));
    jLabel4.setFont(new java.awt.Font("Serif", 3, 15));
    jLabel4.setForeground(SystemColor.activeCaption);
    jLabel4.setBorder(BorderFactory.createLineBorder(Color.black));
    jLabel4.setText("JNBus->公交公司");

    jLabel5.setBounds(new Rectangle(0, 0, 305, 25));
    jLabel5.setFont(new java.awt.Font("Serif", 3, 15));
    jLabel5.setForeground(SystemColor.activeCaption);
    jLabel5.setBorder(BorderFactory.createLineBorder(Color.black));
    jLabel5.setText("JNBus->帮助");

    ImageIcon spring1 = new ImageIcon("picture/spring1.jpg");
    jLabel6.setBounds(new Rectangle(0, 25, 80, 120));
    jLabel6.setIcon(spring1);
    jLabel6.setVerticalAlignment(SwingConstants.TOP);
    jLabel6.setVerticalTextPosition(SwingConstants.TOP);

    ImageIcon olympic = new ImageIcon("picture/olympic.jpg");
    jLabel12.setBounds(new Rectangle(0, 145, 80, 100));
    jLabel12.setIcon(olympic);

    readhelp(); //读取帮助内容
    jTextArea4.setBackground(SystemColor.activeCaptionText);
    jTextArea4.setFont(new java.awt.Font("Serif", 0, 13));
    jTextArea4.setForeground(SystemColor.activeCaption);
    jTextArea4.setEditable(false);
    jTextArea4.setText(helptxt);

    readjnbus(); //读取济南公交公司资料
    jTextArea6.setBackground(SystemColor.activeCaptionText);
    jTextArea6.setForeground(SystemColor.activeCaption);
    jTextArea6.setBounds(new Rectangle(80, 25, 220, 260));
    jTextArea6.setEditable(false);
    jTextArea6.setText(jnbustxt);

    jPanel8.setBackground(SystemColor.inactiveCaption);
    jPanel8.setBorder(BorderFactory.createLineBorder(Color.black));
    jPanel8.setBounds(new Rectangle(380, 0, 112, 340));
    jPanel8.setLayout(null);

    jTextArea5.setBackground(SystemColor.inactiveCaptionText);
    jTextArea5.setFont(new java.awt.Font("Dialog", 0, 12));
    jTextArea5.setBorder(BorderFactory.createRaisedBevelBorder());
    jTextArea5.setEditable(false);
    jTextArea5.setBounds(new Rectangle(0, 0, 112, 60));

    ImageIcon jl7 = new ImageIcon("picture/bus84.gif");
    ImageIcon jl8 = new ImageIcon("picture/pekingbus.gif");
    ImageIcon jl9 = new ImageIcon("picture/scit.gif");
    ImageIcon jl10 = new ImageIcon("picture/8684.jpg");

    jLabel7.setText("");
    jLabel7.setBounds(new Rectangle(0, 90, 112, 50));
    jLabel7.addMouseListener(new clientFrame_jLabel7_mouseAdapter(this));
    jLabel7.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    jLabel7.setBorder(null);
    jLabel7.setIcon(jl7);
    jLabel8.setText("");
    jLabel8.setBounds(new Rectangle(0, 140, 112, 50));
    jLabel8.addMouseListener(new clientFrame_jLabel8_mouseAdapter(this));
    jLabel8.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    jLabel8.setBorder(null);
    jLabel8.setIcon(jl8);
    jLabel9.setText("");
    jLabel9.setBounds(new Rectangle(0, 190, 112, 50));
    jLabel9.addMouseListener(new clientFrame_jLabel9_mouseAdapter(this));
    jLabel9.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    jLabel9.setIcon(jl9);
    jLabel10.setText("");
    jLabel10.setBounds(new Rectangle(0, 240, 112, 50));
    jLabel10.addMouseListener(new clientFrame_jLabel10_mouseAdapter(this));
    jLabel10.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    jLabel10.setBorder(null);
    jLabel10.setIcon(jl10);

    ImageIcon link = new ImageIcon("picture/link.jpg");
    jLabel11.setFont(new java.awt.Font("Serif", 3, 16));
    jLabel11.setForeground(Color.black);
    jLabel11.setBorder(BorderFactory.createRaisedBevelBorder());
    jLabel11.setText("    友情链接");
    jLabel11.setBounds(new Rectangle(0, 60, 112, 30));
    jLabel11.setIcon(link);

    ImageIcon head = new ImageIcon("picture/head.gif");
    ImageIcon top = new ImageIcon("picture/top.jpg");
    jLabel13.setText("");
    jLabel13.setBounds(new Rectangle(0, 0, 500, 60));
    jLabel13.setIcon(top);

    jPanel9.setLayout(null);
    jPanel9.setBackground(SystemColor.inactiveCaptionText);

    jScrollPane4.setBounds(new Rectangle(2, 29, 302, 269));
    jScrollPane4.getViewport().add(jTextArea4, null);

    jMenuBar1.add(jMenu1);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?