?? tabxianludialog.java
字號:
/*此類是負責線路增,刪,改的界面的規(guī)劃*/
package pro;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.TitledBorder;
import javax.swing.border.Border;
public class TabXianLuDialog extends JDialog implements ActionListener
{
private VoSumBus mVoSumBus;
// private PnlCha mPnl;
private BtnXianJDialog mBd;
private MainFrame mf;
JLabel lblTitle = new JLabel();
JLabel lblLu = new JLabel();
TitledBorder titledBorder1 = new TitledBorder("");
TitledBorder titledBorder2 = new TitledBorder("");
JLabel lblZhan = new JLabel();
TitledBorder titledBorder3 = new TitledBorder("");
JLabel lblPrice = new JLabel();
TitledBorder titledBorder4 = new TitledBorder("");
JLabel lblTel = new JLabel();
JLabel lblLength = new JLabel();
JLabel lblTime = new JLabel();
TitledBorder titledBorder5 = new TitledBorder("");
TitledBorder titledBorder6 = new TitledBorder("");
Border border1 = BorderFactory.createEtchedBorder(Color.white,
new Color(148, 145, 140));
Border border2 = BorderFactory.createEtchedBorder(Color.white,
new Color(148, 145, 140));
Border border3 = BorderFactory.createEtchedBorder(Color.white, Color.pink);
Border border4 = BorderFactory.createEtchedBorder(Color.white,
new Color(0, 243, 255));
Border border5 = BorderFactory.createLineBorder(new Color(118, 223, 230), 2);
JScrollPane jScrollPane1 = new JScrollPane();
JTextArea txtArea = new JTextArea();
JButton btnClose = new JButton();
JLabel lblzhong = new JLabel();
public TabXianLuDialog(BtnCenter bc,VoSumBus voSumBus)
{
super(bc,true);
mVoSumBus=voSumBus;
//mPnl=pnlCha;
String strLu=mVoSumBus.getSBusName();
//String strLu=mPnl.txtXian.getText();
String strStartArea=mVoSumBus.getSStartArea();
String strSEndArea=mVoSumBus.getSEndArea();
String strSGoUp="上行線路: "+mVoSumBus.getSGoUp();
String strSGoDown="下行線路: "+mVoSumBus.getSGoDown();
String strSStartTime=mVoSumBus.getSStartTime().substring(11,16);
String strSendTime=mVoSumBus.getSendTime().substring(11,16);
int inScarfare=mVoSumBus.getScarfare();
String strCare=inScarfare+"";
String fSLength=voSumBus.getSLength()+"";
String strLeng="";
if(fSLength.length()<4)
{
strLeng=fSLength;
}else
{
strLeng=fSLength.substring(0,4);
}
// String strlength=strLeng.substring(0,);
String strSTel=mVoSumBus.getSTelephone();
String strSCompany=mVoSumBus.getSCompany();
this.getContentPane().setLayout(null);
lblTitle.setFont(new java.awt.Font("Dialog", Font.BOLD | Font.ITALIC, 18));
lblTitle.setForeground(new Color(118, 210, 46));
lblTitle.setBorder(null);
lblTitle.setHorizontalAlignment(SwingConstants.CENTER);
lblTitle.setText("線路查詢結(jié)果");
lblTitle.setBounds(new Rectangle(12, 0, 612, 37));
lblLu.setFont(new java.awt.Font("Dialog", Font.BOLD | Font.ITALIC, 29));
lblLu.setForeground(Color.red);
lblLu.setBorder(border5);
// lblLu.setBackground(new UIManager(212, 208, 200));
lblLu.setHorizontalAlignment(SwingConstants.CENTER);
lblLu.setText(strLu);
lblLu.setBounds(new Rectangle(13, 40, 244, 56));
lblZhan.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
lblZhan.setForeground(Color.red);
lblZhan.setBorder(border5);
lblZhan.setHorizontalAlignment(SwingConstants.LEFT);
lblZhan.setText("起點站:"+strStartArea);
lblZhan.setBounds(new Rectangle(13, 94, 244, 32));
lblPrice.setBorder(border5);
lblPrice.setHorizontalAlignment(SwingConstants.CENTER);
lblPrice.setText("票價:"+strCare);
lblPrice.setBounds(new Rectangle(254, 40, 410, 30));
lblTel.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
lblTel.setBorder(border5);
lblTel.setHorizontalAlignment(SwingConstants.CENTER);
lblTel.setText("經(jīng)營公司:"+strSCompany+"; "+"投訴電話:"+strSTel);
lblTel.setBounds(new Rectangle(254, 124, 410, 26));
lblLength.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
lblLength.setBorder(border5);
lblLength.setHorizontalAlignment(SwingConstants.CENTER);
lblLength.setText("線路總長:"+strLeng+"公里");
lblLength.setBounds(new Rectangle(254, 94, 410, 32));
lblTime.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
lblTime.setBorder(border5);
lblTime.setHorizontalAlignment(SwingConstants.CENTER);
lblTime.setText("首班時間:"+strSStartTime+";末班時間:"+strSendTime);
lblTime.setBounds(new Rectangle(254, 67, 410, 31));
jScrollPane1.setBounds(new Rectangle(13, 153, 649, 315));
// txtArea.setBackground(new Color(203, 203, 197));
txtArea.setBounds(new Rectangle(6, 160, 549, 280));
txtArea.setEditable(false);
txtArea.setText("\n\n"+strSGoUp+"\n\n"+"\n"+strSGoDown);
txtArea.setLineWrap(true);
btnClose.setBounds(new Rectangle(257, 494, 117, 27));
btnClose.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
btnClose.setForeground(new Color(92, 210, 46));
btnClose.setText("退出");
lblzhong.setBorder(border5);
lblzhong.setHorizontalAlignment(SwingConstants.LEFT);
lblzhong.setText("終點站:"+strSEndArea);
lblzhong.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
lblzhong.setForeground(Color.red);
lblzhong.setBounds(new Rectangle(13, 124, 244, 26));
this.getContentPane().add(jScrollPane1);
this.getContentPane().add(lblTitle);
this.getContentPane().add(lblTime);
this.getContentPane().add(lblLu);
this.getContentPane().add(lblZhan);
this.getContentPane().add(lblzhong);
this.getContentPane().add(lblPrice);
this.getContentPane().add(lblLength);
this.getContentPane().add(lblTel);
this.getContentPane().add(btnClose);
jScrollPane1.getViewport().add(txtArea);
btnClose.addActionListener(this);
this.setTitle("長沙公交查詢系統(tǒng)");
this.setSize(683,570);
}
/*構(gòu)造函數(shù)重載*/
public TabXianLuDialog(MainFrame mf,VoSumBus voSumBus)
{
super(mf,true);
mVoSumBus=voSumBus;
//mPnl=pnlCha;
String strLu=mVoSumBus.getSBusName();
//String strLu=mPnl.txtXian.getText();
String strStartArea=mVoSumBus.getSStartArea();
String strSEndArea=mVoSumBus.getSEndArea();
String strSGoUp="上行線路: "+mVoSumBus.getSGoUp();
String strSGoDown="下行線路: "+mVoSumBus.getSGoDown();
String strSStartTime=mVoSumBus.getSStartTime().substring(11,16);
String strSendTime=mVoSumBus.getSendTime().substring(11,16);
int inScarfare=mVoSumBus.getScarfare();
String strCare=inScarfare+"";
String fSLength=voSumBus.getSLength()+"";
String strLeng="";
if(fSLength.length()<4)
{
strLeng=fSLength;
}else
{
strLeng=fSLength.substring(0,4);
}
// String strlength=strLeng.substring(0,);
String strSTel=mVoSumBus.getSTelephone();
String strSCompany=mVoSumBus.getSCompany();
this.getContentPane().setLayout(null);
lblTitle.setFont(new java.awt.Font("Dialog", Font.BOLD | Font.ITALIC, 18));
lblTitle.setForeground(new Color(118, 210, 46));
lblTitle.setBorder(null);
lblTitle.setHorizontalAlignment(SwingConstants.CENTER);
lblTitle.setText("線路查詢結(jié)果");
lblTitle.setBounds(new Rectangle(12, 0, 612, 37));
lblLu.setFont(new java.awt.Font("Dialog", Font.BOLD | Font.ITALIC, 29));
lblLu.setForeground(Color.red);
lblLu.setBorder(border5);
// lblLu.setBackground(new UIManager(212, 208, 200));
lblLu.setHorizontalAlignment(SwingConstants.CENTER);
lblLu.setText(strLu);
lblLu.setBounds(new Rectangle(13, 40, 244, 56));
lblZhan.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
lblZhan.setForeground(Color.red);
lblZhan.setBorder(border5);
lblZhan.setHorizontalAlignment(SwingConstants.LEFT);
lblZhan.setText("起點站:"+strStartArea);
lblZhan.setBounds(new Rectangle(13, 94, 244, 32));
lblPrice.setBorder(border5);
lblPrice.setHorizontalAlignment(SwingConstants.CENTER);
lblPrice.setText("票價:"+strCare);
lblPrice.setBounds(new Rectangle(254, 40, 410, 30));
lblTel.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
lblTel.setBorder(border5);
lblTel.setHorizontalAlignment(SwingConstants.CENTER);
lblTel.setText("經(jīng)營公司:"+strSCompany+"; "+"投訴電話:"+strSTel);
lblTel.setBounds(new Rectangle(254, 124, 410, 26));
lblLength.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
lblLength.setBorder(border5);
lblLength.setHorizontalAlignment(SwingConstants.CENTER);
lblLength.setText("線路總長:"+strLeng+"公里");
lblLength.setBounds(new Rectangle(254, 94, 410, 32));
lblTime.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
lblTime.setBorder(border5);
lblTime.setHorizontalAlignment(SwingConstants.CENTER);
lblTime.setText("首班時間:"+strSStartTime+";末班時間:"+strSendTime);
lblTime.setBounds(new Rectangle(254, 67, 410, 31));
jScrollPane1.setBounds(new Rectangle(13, 153, 649, 315));
// txtArea.setBackground(new Color(203, 203, 197));
txtArea.setBounds(new Rectangle(6, 160, 549, 280));
txtArea.setEditable(false);
txtArea.setText("\n\n"+strSGoUp+"\n\n"+"\n"+strSGoDown);
txtArea.setLineWrap(true);
btnClose.setBounds(new Rectangle(257, 494, 117, 27));
btnClose.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
btnClose.setForeground(new Color(92, 210, 46));
btnClose.setText("退出");
lblzhong.setBorder(border5);
lblzhong.setHorizontalAlignment(SwingConstants.LEFT);
lblzhong.setText("終點站:"+strSEndArea);
lblzhong.setFont(new java.awt.Font("Dialog", Font.PLAIN, 12));
lblzhong.setForeground(Color.red);
lblzhong.setBounds(new Rectangle(13, 124, 244, 26));
this.getContentPane().add(jScrollPane1);
this.getContentPane().add(lblTitle);
this.getContentPane().add(lblTime);
this.getContentPane().add(lblLu);
this.getContentPane().add(lblZhan);
this.getContentPane().add(lblzhong);
this.getContentPane().add(lblPrice);
this.getContentPane().add(lblLength);
this.getContentPane().add(lblTel);
this.getContentPane().add(btnClose);
jScrollPane1.getViewport().add(txtArea);
btnClose.addActionListener(this);
this.setTitle("長沙公交查管理詢系統(tǒng)");
this.setSize(683,570);
}
/*構(gòu)造函數(shù)重載*/
public TabXianLuDialog(BtnJianZhuFrame bc,VoSumBus voSumBus)
{
super(bc,true);
mVoSumBus=voSumBus;
//mPnl=pnlCha;
String strLu=mVoSumBus.getSBusName();
//String strLu=mPnl.txtXian.getText();
String strStartArea=mVoSumBus.getSStartArea();
String strSEndArea=mVoSumBus.getSEndArea();
String strSGoUp="上行線路: "+mVoSumBus.getSGoUp();
String strSGoDown="下行線路: "+mVoSumBus.getSGoDown();
String strSStartTime=mVoSumBus.getSStartTime().substring(11,16);
String strSendTime=mVoSumBus.getSendTime().substring(11,16);
int inScarfare=mVoSumBus.getScarfare();
String strCare=inScarfare+"";
String fSLength=voSumBus.getSLength()+"";
String strLeng="";
if(fSLength.length()<4)
{
strLeng=fSLength;
}else
{
strLeng=fSLength.substring(0,4);
}
// String strlength=strLeng.substring(0,);
String strSTel=mVoSumBus.getSTelephone();
String strSCompany=mVoSumBus.getSCompany();
this.getContentPane().setLayout(null);
lblTitle.setFont(new java.awt.Font("Dialog", Font.BOLD | Font.ITALIC, 18));
lblTitle.setForeground(new Color(118, 210, 46));
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -