Second commit
@@ -0,0 +1,141 @@
|
|||||||
|
package xjdx.rjxy.airplane.view;
|
||||||
|
|
||||||
|
import javax.swing.*;
|
||||||
|
import java.awt.*;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
|
||||||
|
public class AddFlight extends JFrame implements ActionListener {
|
||||||
|
String year[] = {null, "2022", "2023", "2024"};
|
||||||
|
String month[] = {null, "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"};
|
||||||
|
String day[] = {null, "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"};
|
||||||
|
String clock[] = {null, "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "00"};
|
||||||
|
String minute[] = {null, "0", "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", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50,", "51", "52", "53", "54", "55", "56", "57", "58", "59", "60"};
|
||||||
|
JComboBox yearBox, monthBox, dayBox, clockBox, minuteBox;
|
||||||
|
JTextField typeField, rateField;
|
||||||
|
JButton backBtn, okBtn;
|
||||||
|
|
||||||
|
public AddFlight() {
|
||||||
|
super("飞机订票系统后台管理 v1.0>>添加飞机");
|
||||||
|
//改变按钮样式
|
||||||
|
try {
|
||||||
|
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
|
||||||
|
} catch (ClassNotFoundException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (InstantiationException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (UnsupportedLookAndFeelException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
//设置ICO图标
|
||||||
|
Image im;
|
||||||
|
ImageIcon ig = new ImageIcon("E:\\JavaProjects_IDEA\\Airline Reservation System\\src\\xjdx\\rjxy\\airplane\\view\\images\\ico.jpg");//设置图标图片
|
||||||
|
im = ig.getImage();
|
||||||
|
setIconImage(im);
|
||||||
|
//设置背景图
|
||||||
|
ImageIcon icon = new ImageIcon("E:\\JavaProjects_IDEA\\Airline Reservation System\\src\\xjdx\\rjxy\\airplane\\view\\images\\AdminBackGround.jpg");//背景图
|
||||||
|
JLabel label = new JLabel(icon);//标签中加入图片
|
||||||
|
label.setBounds(0, 0, icon.getIconWidth(), icon.getIconHeight());//设置标签位置大小为图片大小
|
||||||
|
getLayeredPane().add(label, Integer.valueOf(Integer.MIN_VALUE));//标签添加到第二层面板
|
||||||
|
//获取顶层容器设为透明
|
||||||
|
JPanel Panel = (JPanel) getContentPane();
|
||||||
|
Panel.setOpaque(false);
|
||||||
|
getContentPane().setLayout(null);
|
||||||
|
|
||||||
|
Font font = new Font("楷体", Font.TYPE1_FONT, 20);
|
||||||
|
|
||||||
|
JLabel typeLab = new JLabel("飞机型号:");
|
||||||
|
typeLab.setFont(font);
|
||||||
|
JLabel rateLab = new JLabel("准 点 率:");
|
||||||
|
rateLab.setFont(font);
|
||||||
|
JLabel timeLab = new JLabel("起飞时间:");
|
||||||
|
timeLab.setFont(font);
|
||||||
|
|
||||||
|
JPanel panel = new JPanel();
|
||||||
|
panel.setBounds(50, 40, 100, 100);
|
||||||
|
panel.setOpaque(false);
|
||||||
|
panel.setLayout(new FlowLayout());
|
||||||
|
panel.add(typeLab);
|
||||||
|
panel.add(rateLab);
|
||||||
|
panel.add(timeLab);
|
||||||
|
this.add(panel);
|
||||||
|
|
||||||
|
typeField = new JTextField(25);
|
||||||
|
rateField = new JTextField(25);
|
||||||
|
JPanel panel1 = new JPanel();
|
||||||
|
panel1.setBounds(150, 40, 160, 100);
|
||||||
|
panel1.setOpaque(false);
|
||||||
|
panel1.setLayout(new FlowLayout(0, 0, 7));
|
||||||
|
panel1.add(typeField);
|
||||||
|
panel1.add(rateField);
|
||||||
|
this.add(panel1);
|
||||||
|
|
||||||
|
yearBox = new JComboBox(year);
|
||||||
|
monthBox = new JComboBox(month);
|
||||||
|
dayBox = new JComboBox(day);
|
||||||
|
clockBox = new JComboBox(clock);
|
||||||
|
minuteBox = new JComboBox(minute);
|
||||||
|
|
||||||
|
JLabel yearLab = new JLabel("年");
|
||||||
|
JLabel monthLab = new JLabel("月");
|
||||||
|
JLabel dayLab = new JLabel("日");
|
||||||
|
JLabel clockLab = new JLabel("时");
|
||||||
|
JLabel minuteLab = new JLabel("分");
|
||||||
|
|
||||||
|
JPanel panel2 = new JPanel();
|
||||||
|
panel2.setBounds(45, 130, 350, 50);
|
||||||
|
panel2.setOpaque(false);
|
||||||
|
panel2.setLayout(new FlowLayout());
|
||||||
|
panel2.add(yearBox);
|
||||||
|
panel2.add(yearLab);
|
||||||
|
panel2.add(monthBox);
|
||||||
|
panel2.add(monthLab);
|
||||||
|
panel2.add(dayBox);
|
||||||
|
panel2.add(dayLab);
|
||||||
|
panel2.add(clockBox);
|
||||||
|
panel2.add(clockLab);
|
||||||
|
panel2.add(minuteBox);
|
||||||
|
panel2.add(minuteLab);
|
||||||
|
|
||||||
|
this.add(panel2);
|
||||||
|
|
||||||
|
okBtn = new JButton("添加");
|
||||||
|
okBtn.setFont(font);
|
||||||
|
okBtn.setBounds(155, 180, 80, 40);
|
||||||
|
okBtn.setBorder(null); //取消边框
|
||||||
|
okBtn.setBorder(BorderFactory.createRaisedBevelBorder()); //设置突起
|
||||||
|
this.add(okBtn);
|
||||||
|
|
||||||
|
backBtn = new JButton("<<");
|
||||||
|
backBtn.setFont(font);
|
||||||
|
backBtn.setBounds(0, 0, 70, 30);
|
||||||
|
backBtn.setContentAreaFilled(false); //设置按钮透明
|
||||||
|
backBtn.setBorder(null); //取消边框
|
||||||
|
this.add(backBtn);
|
||||||
|
|
||||||
|
setBounds(600, 300, 400, 300);
|
||||||
|
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||||
|
setVisible(true);
|
||||||
|
setResizable(false);
|
||||||
|
setTitle(getTitle());
|
||||||
|
|
||||||
|
okBtn.addActionListener(this);
|
||||||
|
backBtn.addActionListener(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
new AddFlight();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
if (e.getSource() == backBtn) {
|
||||||
|
this.dispose();
|
||||||
|
}
|
||||||
|
if (e.getSource() == okBtn) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,187 @@
|
|||||||
|
package xjdx.rjxy.airplane.view;
|
||||||
|
|
||||||
|
import javax.swing.*;
|
||||||
|
import java.awt.*;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
|
||||||
|
public class AddRoute extends JFrame implements ActionListener {
|
||||||
|
String year[] = {null, "2022", "2023", "2024"};
|
||||||
|
String month[] = {null, "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"};
|
||||||
|
String day[] = {null, "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"};
|
||||||
|
String clock[] = {null, "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "00"};
|
||||||
|
String minute[] = {null, "0", "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", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50,", "51", "52", "53", "54", "55", "56", "57", "58", "59", "60"};
|
||||||
|
JComboBox yearBox, monthBox, dayBox, clockBox, minuteBox, yearBox2, monthBox2, dayBox2, clockBox2, minuteBox2, startBox, endBox;
|
||||||
|
JTextField typeField;
|
||||||
|
JButton backBtn, okBtn;
|
||||||
|
String cityList[] = {null, "--请选择城市--", "北京市", "天津市", "上海市", "重庆市", "河北省", "山西省", "辽宁省", "吉林省", "黑龙江省", "江苏省", "浙江省", "安徽省", "福建省", "江西省", "山东省", "河南省", "湖北省", "湖南省", "广东省", "海南省", "四川省", "贵州省", "云南省", "陕西省", "甘肃省", "青海省", "台湾省", "内蒙古自治区", "广西壮族自治区", "西藏自治区", "宁夏回族自治区", "新疆维吾尔自治区", "香港特别行政区", "澳门特别行政区"};
|
||||||
|
|
||||||
|
|
||||||
|
public AddRoute() {
|
||||||
|
super("飞机订票系统后台管理 v1.0>>添加航线");
|
||||||
|
//改变按钮样式
|
||||||
|
try {
|
||||||
|
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
|
||||||
|
} catch (ClassNotFoundException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (InstantiationException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (UnsupportedLookAndFeelException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
//设置ICO图标
|
||||||
|
Image im;
|
||||||
|
ImageIcon ig = new ImageIcon("E:\\JavaProjects_IDEA\\Airline Reservation System\\src\\xjdx\\rjxy\\airplane\\view\\images\\ico.jpg");//设置图标图片
|
||||||
|
im = ig.getImage();
|
||||||
|
setIconImage(im);
|
||||||
|
//设置背景图
|
||||||
|
ImageIcon icon = new ImageIcon("E:\\JavaProjects_IDEA\\Airline Reservation System\\src\\xjdx\\rjxy\\airplane\\view\\images\\AdminBackGround.jpg");//背景图
|
||||||
|
JLabel label = new JLabel(icon);//标签中加入图片
|
||||||
|
label.setBounds(0, 0, icon.getIconWidth(), icon.getIconHeight());//设置标签位置大小为图片大小
|
||||||
|
getLayeredPane().add(label, Integer.valueOf(Integer.MIN_VALUE));//标签添加到第二层面板
|
||||||
|
//获取顶层容器设为透明
|
||||||
|
JPanel Panel = (JPanel) getContentPane();
|
||||||
|
Panel.setOpaque(false);
|
||||||
|
getContentPane().setLayout(null);
|
||||||
|
|
||||||
|
Font font = new Font("楷体", Font.TYPE1_FONT, 20);
|
||||||
|
|
||||||
|
JLabel typeLab = new JLabel("飞机型号:");
|
||||||
|
typeLab.setFont(font);
|
||||||
|
JLabel startLab = new JLabel("出 发 地:");
|
||||||
|
startLab.setFont(font);
|
||||||
|
JLabel endLab = new JLabel("目 的 地:");
|
||||||
|
endLab.setFont(font);
|
||||||
|
|
||||||
|
|
||||||
|
JPanel panel = new JPanel();
|
||||||
|
panel.setBounds(50, 20, 100, 100);
|
||||||
|
panel.setOpaque(false);
|
||||||
|
panel.setLayout(new FlowLayout());
|
||||||
|
panel.add(typeLab);
|
||||||
|
panel.add(startLab);
|
||||||
|
panel.add(endLab);
|
||||||
|
|
||||||
|
this.add(panel);
|
||||||
|
|
||||||
|
typeField = new JTextField(25);
|
||||||
|
startBox = new JComboBox(cityList);
|
||||||
|
endBox = new JComboBox(cityList);
|
||||||
|
|
||||||
|
|
||||||
|
JPanel panel1 = new JPanel();
|
||||||
|
panel1.setBounds(150, 20, 160, 100);
|
||||||
|
panel1.setOpaque(false);
|
||||||
|
panel1.setLayout(new FlowLayout(0, 0, 7));
|
||||||
|
panel1.add(typeField);
|
||||||
|
panel1.add(startBox);
|
||||||
|
panel1.add(endBox);
|
||||||
|
this.add(panel1);
|
||||||
|
|
||||||
|
yearBox = new JComboBox(year);
|
||||||
|
monthBox = new JComboBox(month);
|
||||||
|
dayBox = new JComboBox(day);
|
||||||
|
clockBox = new JComboBox(clock);
|
||||||
|
minuteBox = new JComboBox(minute);
|
||||||
|
|
||||||
|
JLabel startTimeLab = new JLabel("出发时间:");
|
||||||
|
startTimeLab.setFont(font);
|
||||||
|
JLabel endTimeLab = new JLabel("到达时间:");
|
||||||
|
endTimeLab.setFont(font);
|
||||||
|
startTimeLab.setBounds(55, 105, 100, 30);
|
||||||
|
this.add(startTimeLab);
|
||||||
|
endTimeLab.setFont(font);
|
||||||
|
endTimeLab.setBounds(55, 155, 100, 30);
|
||||||
|
this.add(endTimeLab);
|
||||||
|
|
||||||
|
JLabel yearLab = new JLabel("年");
|
||||||
|
JLabel monthLab = new JLabel("月");
|
||||||
|
JLabel dayLab = new JLabel("日");
|
||||||
|
JLabel clockLab = new JLabel("时");
|
||||||
|
JLabel minuteLab = new JLabel("分");
|
||||||
|
|
||||||
|
JPanel panel2 = new JPanel();
|
||||||
|
panel2.setBounds(45, 130, 350, 50);
|
||||||
|
panel2.setOpaque(false);
|
||||||
|
panel2.setLayout(new FlowLayout());
|
||||||
|
panel2.add(yearBox);
|
||||||
|
panel2.add(yearLab);
|
||||||
|
panel2.add(monthBox);
|
||||||
|
panel2.add(monthLab);
|
||||||
|
panel2.add(dayBox);
|
||||||
|
panel2.add(dayLab);
|
||||||
|
panel2.add(clockBox);
|
||||||
|
panel2.add(clockLab);
|
||||||
|
panel2.add(minuteBox);
|
||||||
|
panel2.add(minuteLab);
|
||||||
|
|
||||||
|
|
||||||
|
yearBox2 = new JComboBox(year);
|
||||||
|
monthBox2 = new JComboBox(month);
|
||||||
|
dayBox2 = new JComboBox(day);
|
||||||
|
clockBox2 = new JComboBox(clock);
|
||||||
|
minuteBox2 = new JComboBox(minute);
|
||||||
|
JLabel yearLab2 = new JLabel("年");
|
||||||
|
JLabel monthLab2 = new JLabel("月");
|
||||||
|
JLabel dayLab2 = new JLabel("日");
|
||||||
|
JLabel clockLab2 = new JLabel("时");
|
||||||
|
JLabel minuteLab2 = new JLabel("分");
|
||||||
|
|
||||||
|
this.add(panel2);
|
||||||
|
JPanel panel3 = new JPanel();
|
||||||
|
panel3.setBounds(45, 180, 350, 30);
|
||||||
|
panel3.setOpaque(false);
|
||||||
|
panel3.setLayout(new FlowLayout());
|
||||||
|
panel3.add(yearBox2);
|
||||||
|
panel3.add(yearLab2);
|
||||||
|
panel3.add(monthBox2);
|
||||||
|
panel3.add(monthLab2);
|
||||||
|
panel3.add(dayBox2);
|
||||||
|
panel3.add(dayLab2);
|
||||||
|
panel3.add(clockBox2);
|
||||||
|
panel3.add(clockLab2);
|
||||||
|
panel3.add(minuteBox2);
|
||||||
|
panel3.add(minuteLab2);
|
||||||
|
|
||||||
|
this.add(panel3);
|
||||||
|
|
||||||
|
okBtn = new JButton("添加");
|
||||||
|
okBtn.setFont(font);
|
||||||
|
okBtn.setBounds(155, 220, 80, 40);
|
||||||
|
okBtn.setBorder(null); //取消边框
|
||||||
|
okBtn.setBorder(BorderFactory.createRaisedBevelBorder()); //设置突起
|
||||||
|
this.add(okBtn);
|
||||||
|
|
||||||
|
backBtn = new JButton("<<");
|
||||||
|
backBtn.setFont(font);
|
||||||
|
backBtn.setBounds(0, 0, 70, 30);
|
||||||
|
backBtn.setContentAreaFilled(false); //设置按钮透明
|
||||||
|
backBtn.setBorder(null); //取消边框
|
||||||
|
this.add(backBtn);
|
||||||
|
|
||||||
|
setBounds(600, 300, 400, 300);
|
||||||
|
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||||
|
setVisible(true);
|
||||||
|
setResizable(false);
|
||||||
|
setTitle(getTitle());
|
||||||
|
|
||||||
|
okBtn.addActionListener(this);
|
||||||
|
backBtn.addActionListener(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
new AddRoute();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
if (e.getSource() == backBtn) {
|
||||||
|
this.dispose();
|
||||||
|
}
|
||||||
|
if (e.getSource() == okBtn) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,125 @@
|
|||||||
|
package xjdx.rjxy.airplane.view;
|
||||||
|
|
||||||
|
import javax.swing.*;
|
||||||
|
import java.awt.*;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
|
||||||
|
public class AddTicket extends JFrame implements ActionListener {
|
||||||
|
String cabin[] = {"舱位不限", "经济舱", "公务舱,头等舱"};
|
||||||
|
String pew[] = {"1A", "1B", "1C", "1D", "2A", "2B", "2C", "2D", "2A", "3B", "3C", "3D", "4A", "4B", "4C", "4D", "5A", "5B", "5C", "5D",};
|
||||||
|
|
||||||
|
JTextField numberField, priceField, refundPriceField;
|
||||||
|
JButton backBtn, okBtn;
|
||||||
|
JComboBox seatNumberBox, ticketTypeBox;
|
||||||
|
|
||||||
|
public AddTicket() {
|
||||||
|
super("飞机订票系统后台管理 v1.0>>添加机票");
|
||||||
|
//改变按钮样式
|
||||||
|
try {
|
||||||
|
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
|
||||||
|
} catch (ClassNotFoundException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (InstantiationException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (UnsupportedLookAndFeelException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
//设置ICO图标
|
||||||
|
Image im;
|
||||||
|
ImageIcon ig = new ImageIcon("E:\\JavaProjects_IDEA\\Airline Reservation System\\src\\xjdx\\rjxy\\airplane\\view\\images\\ico.jpg");//设置图标图片
|
||||||
|
im = ig.getImage();
|
||||||
|
setIconImage(im);
|
||||||
|
//设置背景图
|
||||||
|
ImageIcon icon = new ImageIcon("E:\\JavaProjects_IDEA\\Airline Reservation System\\src\\xjdx\\rjxy\\airplane\\view\\images\\AdminBackGround.jpg");//背景图
|
||||||
|
JLabel label = new JLabel(icon);//标签中加入图片
|
||||||
|
label.setBounds(0, 0, icon.getIconWidth(), icon.getIconHeight());//设置标签位置大小为图片大小
|
||||||
|
getLayeredPane().add(label, Integer.valueOf(Integer.MIN_VALUE));//标签添加到第二层面板
|
||||||
|
//获取顶层容器设为透明
|
||||||
|
JPanel Panel = (JPanel) getContentPane();
|
||||||
|
Panel.setOpaque(false);
|
||||||
|
getContentPane().setLayout(null);
|
||||||
|
|
||||||
|
Font font = new Font("楷体", Font.TYPE1_FONT, 20);
|
||||||
|
|
||||||
|
JLabel numberLab = new JLabel("机票编号:");
|
||||||
|
numberLab.setFont(font);
|
||||||
|
JLabel priceLab = new JLabel("机票价格:");
|
||||||
|
priceLab.setFont(font);
|
||||||
|
JLabel refundLab = new JLabel("退票价格:");
|
||||||
|
refundLab.setFont(font);
|
||||||
|
JLabel ticketTypeLab = new JLabel("机票类型:");
|
||||||
|
ticketTypeLab.setFont(font);
|
||||||
|
JLabel seatNumberLab = new JLabel("座位编号:");
|
||||||
|
seatNumberLab.setFont(font);
|
||||||
|
|
||||||
|
JPanel panel = new JPanel();
|
||||||
|
panel.setBounds(50, 40, 100, 150);
|
||||||
|
panel.setOpaque(false);
|
||||||
|
panel.setLayout(new FlowLayout());
|
||||||
|
panel.add(numberLab);
|
||||||
|
panel.add(priceLab);
|
||||||
|
panel.add(refundLab);
|
||||||
|
panel.add(ticketTypeLab);
|
||||||
|
panel.add(seatNumberLab);
|
||||||
|
this.add(panel);
|
||||||
|
|
||||||
|
numberField = new JTextField(25);
|
||||||
|
priceField = new JTextField(25);
|
||||||
|
refundPriceField = new JTextField(25);
|
||||||
|
ticketTypeBox = new JComboBox(cabin);
|
||||||
|
seatNumberBox = new JComboBox(pew);
|
||||||
|
seatNumberBox.setPreferredSize(new Dimension(105, 20));
|
||||||
|
JPanel panel1 = new JPanel();
|
||||||
|
|
||||||
|
panel1.setBounds(145, 40, 170, 150);
|
||||||
|
panel1.setOpaque(false);
|
||||||
|
panel1.setLayout(new FlowLayout(0, 0, 7));
|
||||||
|
panel1.add(numberField);
|
||||||
|
panel1.add(priceField);
|
||||||
|
panel1.add(refundPriceField);
|
||||||
|
panel1.add(ticketTypeBox);
|
||||||
|
panel1.add(seatNumberBox);
|
||||||
|
this.add(panel1);
|
||||||
|
|
||||||
|
|
||||||
|
okBtn = new JButton("添加");
|
||||||
|
okBtn.setFont(font);
|
||||||
|
okBtn.setBounds(155, 210, 80, 40);
|
||||||
|
okBtn.setBorder(null); //取消边框
|
||||||
|
okBtn.setBorder(BorderFactory.createRaisedBevelBorder()); //设置突起
|
||||||
|
this.add(okBtn);
|
||||||
|
|
||||||
|
backBtn = new JButton("<<");
|
||||||
|
backBtn.setFont(font);
|
||||||
|
backBtn.setBounds(0, 0, 70, 30);
|
||||||
|
backBtn.setContentAreaFilled(false); //设置按钮透明
|
||||||
|
backBtn.setBorder(null); //取消边框
|
||||||
|
this.add(backBtn);
|
||||||
|
|
||||||
|
setBounds(600, 300, 400, 300);
|
||||||
|
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||||
|
setVisible(true);
|
||||||
|
setResizable(false);
|
||||||
|
setTitle(getTitle());
|
||||||
|
|
||||||
|
okBtn.addActionListener(this);
|
||||||
|
backBtn.addActionListener(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
new AddTicket();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
if (e.getSource() == backBtn) {
|
||||||
|
this.dispose();
|
||||||
|
}
|
||||||
|
if (e.getSource() == okBtn) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,114 @@
|
|||||||
|
package xjdx.rjxy.airplane.view;
|
||||||
|
|
||||||
|
import javax.swing.*;
|
||||||
|
import java.awt.*;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
|
||||||
|
public class AddUser extends JFrame implements ActionListener {
|
||||||
|
String year[] = {null, "2022", "2023", "2024"};
|
||||||
|
String month[] = {null, "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"};
|
||||||
|
String day[] = {null, "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"};
|
||||||
|
String clock[] = {null, "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "00"};
|
||||||
|
String minute[] = {null, "0", "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", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50,", "51", "52", "53", "54", "55", "56", "57", "58", "59", "60"};
|
||||||
|
JComboBox yearBox, monthBox, dayBox, clockBox, minuteBox;
|
||||||
|
JTextField nameField, rpasswordField;
|
||||||
|
JButton backBtn, okBtn;
|
||||||
|
|
||||||
|
public AddUser() {
|
||||||
|
super("飞机订票系统后台管理 v1.0>>添加用户");
|
||||||
|
//改变按钮样式
|
||||||
|
try {
|
||||||
|
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
|
||||||
|
} catch (ClassNotFoundException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (InstantiationException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (UnsupportedLookAndFeelException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
//设置ICO图标
|
||||||
|
Image im;
|
||||||
|
ImageIcon ig = new ImageIcon("E:\\JavaProjects_IDEA\\Airline Reservation System\\src\\xjdx\\rjxy\\airplane\\view\\images\\ico.jpg");//设置图标图片
|
||||||
|
im = ig.getImage();
|
||||||
|
setIconImage(im);
|
||||||
|
//设置背景图
|
||||||
|
ImageIcon icon = new ImageIcon("E:\\JavaProjects_IDEA\\Airline Reservation System\\src\\xjdx\\rjxy\\airplane\\view\\images\\AdminBackGround.jpg");//背景图
|
||||||
|
JLabel label = new JLabel(icon);//标签中加入图片
|
||||||
|
label.setBounds(0, 0, icon.getIconWidth(), icon.getIconHeight());//设置标签位置大小为图片大小
|
||||||
|
getLayeredPane().add(label, Integer.valueOf(Integer.MIN_VALUE));//标签添加到第二层面板
|
||||||
|
//获取顶层容器设为透明
|
||||||
|
JPanel Panel = (JPanel) getContentPane();
|
||||||
|
Panel.setOpaque(false);
|
||||||
|
getContentPane().setLayout(null);
|
||||||
|
|
||||||
|
Font font = new Font("楷体", Font.TYPE1_FONT, 20);
|
||||||
|
|
||||||
|
JLabel nameLab = new JLabel("用户名:");
|
||||||
|
nameLab.setFont(font);
|
||||||
|
JLabel passwordLab = new JLabel("密 码:");
|
||||||
|
passwordLab.setFont(font);
|
||||||
|
|
||||||
|
|
||||||
|
JPanel panel = new JPanel();
|
||||||
|
panel.setBounds(50, 70, 100, 100);
|
||||||
|
panel.setOpaque(false);
|
||||||
|
panel.setLayout(new FlowLayout());
|
||||||
|
panel.add(nameLab);
|
||||||
|
panel.add(passwordLab);
|
||||||
|
|
||||||
|
this.add(panel);
|
||||||
|
|
||||||
|
nameField = new JTextField(25);
|
||||||
|
rpasswordField = new JTextField(25);
|
||||||
|
|
||||||
|
JPanel panel1 = new JPanel();
|
||||||
|
panel1.setBounds(150, 70, 160, 100);
|
||||||
|
panel1.setOpaque(false);
|
||||||
|
panel1.setLayout(new FlowLayout(0, 0, 7));
|
||||||
|
panel1.add(nameField);
|
||||||
|
panel1.add(rpasswordField);
|
||||||
|
|
||||||
|
this.add(panel1);
|
||||||
|
|
||||||
|
|
||||||
|
okBtn = new JButton("添加");
|
||||||
|
okBtn.setFont(font);
|
||||||
|
okBtn.setBounds(155, 180, 80, 40);
|
||||||
|
okBtn.setBorder(null); //取消边框
|
||||||
|
okBtn.setBorder(BorderFactory.createRaisedBevelBorder()); //设置突起
|
||||||
|
this.add(okBtn);
|
||||||
|
|
||||||
|
backBtn = new JButton("<<");
|
||||||
|
backBtn.setFont(font);
|
||||||
|
backBtn.setBounds(0, 0, 70, 30);
|
||||||
|
backBtn.setContentAreaFilled(false); //设置按钮透明
|
||||||
|
backBtn.setBorder(null); //取消边框
|
||||||
|
this.add(backBtn);
|
||||||
|
|
||||||
|
setBounds(600, 300, 400, 300);
|
||||||
|
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||||
|
setVisible(true);
|
||||||
|
setResizable(false);
|
||||||
|
setTitle(getTitle());
|
||||||
|
|
||||||
|
okBtn.addActionListener(this);
|
||||||
|
backBtn.addActionListener(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
new AddUser();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
if (e.getSource() == backBtn) {
|
||||||
|
this.dispose();
|
||||||
|
}
|
||||||
|
if (e.getSource() == okBtn) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,455 @@
|
|||||||
|
package xjdx.rjxy.airplane.view;
|
||||||
|
|
||||||
|
import javax.swing.*;
|
||||||
|
import java.awt.*;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
import java.awt.event.MouseAdapter;
|
||||||
|
import java.awt.event.MouseEvent;
|
||||||
|
|
||||||
|
public class AdminMainPage extends JFrame implements ActionListener {
|
||||||
|
String year[] = {null, "2022", "2023", "2024"};
|
||||||
|
String month[] = {null, "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"};
|
||||||
|
String day[] = {null, "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"};
|
||||||
|
String clock[] = {null, "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "00"};
|
||||||
|
String minute[] = {null, "0", "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", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50,", "51", "52", "53", "54", "55", "56", "57", "58", "59", "60"};
|
||||||
|
|
||||||
|
String cityList[] = {null, "--请选择城市--", "北京市", "天津市", "上海市", "重庆市", "河北省", "山西省", "辽宁省", "吉林省", "黑龙江省", "江苏省", "浙江省", "安徽省", "福建省", "江西省", "山东省", "河南省", "湖北省", "湖南省", "广东省", "海南省", "四川省", "贵州省", "云南省", "陕西省", "甘肃省", "青海省", "台湾省", "内蒙古自治区", "广西壮族自治区", "西藏自治区", "宁夏回族自治区", "新疆维吾尔自治区", "香港特别行政区", "澳门特别行政区"};
|
||||||
|
JPanel showPan;
|
||||||
|
JScrollPane scrollPane;
|
||||||
|
JTextArea showInfo;
|
||||||
|
JLabel titleLab;
|
||||||
|
JMenuBar menuBar;
|
||||||
|
JMenu administrator;
|
||||||
|
JMenuItem signOut, currentAdmin, helpMenu;
|
||||||
|
|
||||||
|
JButton addFlightBtn, deleteFlightBtn, addRouteBtn, deleteRouteBtn, addTicketBtn, deleteTicketBtn, deleteUserBtn, currentFlightBtn, currentRouteBtn, currentTicketBtn, currentUser, addUserBtn;
|
||||||
|
JMenuItem all, copy, past, refresh, shi, shiwu, ershi, erhshiwu, sanshi, redFont, blueFont, yellowFont, blackFont, greenFont, whiteFont, deleteUser;
|
||||||
|
JPopupMenu popupMenu;
|
||||||
|
private Icon deleteIco = new ImageIcon("E:\\JavaProjects_IDEA\\Airline Reservation System\\src\\xjdx\\rjxy\\airplane\\view\\images\\删除.png");
|
||||||
|
private Icon addIco = new ImageIcon("E:\\JavaProjects_IDEA\\Airline Reservation System\\src\\xjdx\\rjxy\\airplane\\view\\images\\新建添加.png");
|
||||||
|
private Icon currentIco = new ImageIcon("E:\\JavaProjects_IDEA\\Airline Reservation System\\src\\xjdx\\rjxy\\airplane\\view\\images\\进货单 focus.png");
|
||||||
|
|
||||||
|
public AdminMainPage() {
|
||||||
|
super("飞机订票系统后台管理 v1.0>>主页面");
|
||||||
|
|
||||||
|
//改变按钮的样式
|
||||||
|
try {
|
||||||
|
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
|
||||||
|
} catch (ClassNotFoundException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (InstantiationException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (UnsupportedLookAndFeelException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
//设置ICO图标
|
||||||
|
Image im;
|
||||||
|
ImageIcon ig = new ImageIcon("E:\\JavaProjects_IDEA\\Airline Reservation System\\src\\xjdx\\rjxy\\airplane\\view\\images\\ico.jpg");//设置图标图片
|
||||||
|
im = ig.getImage();
|
||||||
|
setIconImage(im);
|
||||||
|
//设置背景图
|
||||||
|
ImageIcon icon = new ImageIcon("E:\\JavaProjects_IDEA\\Airline Reservation System\\src\\xjdx\\rjxy\\airplane\\view\\images\\AdminBackGround2.jpg");//背景图
|
||||||
|
JLabel label = new JLabel(icon);//标签中加入图片
|
||||||
|
label.setBounds(0, 0, icon.getIconWidth(), icon.getIconHeight());//设置标签位置大小为图片大小
|
||||||
|
getLayeredPane().add(label, Integer.valueOf(Integer.MIN_VALUE));//标签添加到第二层面板
|
||||||
|
//获取顶层容器设为透明
|
||||||
|
JPanel Panel = (JPanel) getContentPane();
|
||||||
|
Panel.setOpaque(false);
|
||||||
|
getContentPane().setLayout(null);
|
||||||
|
|
||||||
|
//标题
|
||||||
|
JPanel titlePan = new JPanel();
|
||||||
|
titlePan.setOpaque(false);
|
||||||
|
titleLab = new JLabel("飞机订票系统后台管理");
|
||||||
|
Font font = new Font("楷体", Font.TYPE1_FONT, 30);
|
||||||
|
titleLab.setFont(font);
|
||||||
|
titleLab.setForeground(Color.white);
|
||||||
|
titlePan.setBounds(0, 0, 1000, 50);
|
||||||
|
titlePan.add(titleLab);
|
||||||
|
this.add(titlePan);
|
||||||
|
|
||||||
|
//信息展示框
|
||||||
|
Font font1 = new Font("楷体", Font.PLAIN, 20);
|
||||||
|
showPan = new JPanel();
|
||||||
|
showPan.setOpaque(false);
|
||||||
|
showPan.setBounds(550, 50, 400, 450);
|
||||||
|
showInfo = new JTextArea(27, 49);
|
||||||
|
showInfo.setLineWrap(true); //激活自动换行功能
|
||||||
|
showInfo.setWrapStyleWord(true); // 激活断行不断字功能
|
||||||
|
showInfo.setFont(font1);
|
||||||
|
scrollPane = new JScrollPane();
|
||||||
|
scrollPane.setBounds(550, 50, 400, 470);
|
||||||
|
// scrollPane.setOpaque(false);
|
||||||
|
scrollPane.getViewport().add(showPan);
|
||||||
|
showPan.add(showInfo);
|
||||||
|
this.add(scrollPane);
|
||||||
|
|
||||||
|
Font font2 = new Font("楷体", Font.PLAIN, 15);
|
||||||
|
//添加飞机,删除飞机
|
||||||
|
addFlightBtn = new JButton("添加飞机", addIco);
|
||||||
|
addFlightBtn.setFont(font2);
|
||||||
|
// exchangebtn.setContentAreaFilled(false); //设置按钮透明
|
||||||
|
addFlightBtn.setBorder(null); //取消边框
|
||||||
|
addFlightBtn.setBorder(BorderFactory.createRaisedBevelBorder()); //设置突起
|
||||||
|
|
||||||
|
addFlightBtn.setPreferredSize(new Dimension(150, 50));
|
||||||
|
deleteFlightBtn = new JButton("删除飞机", deleteIco);
|
||||||
|
deleteFlightBtn.setBorder(null); //取消边框
|
||||||
|
deleteFlightBtn.setBorder(BorderFactory.createRaisedBevelBorder()); //设置突起
|
||||||
|
deleteFlightBtn.setFont(font2);
|
||||||
|
deleteFlightBtn.setPreferredSize(new Dimension(150, 50));
|
||||||
|
|
||||||
|
JPanel pan1 = new JPanel();
|
||||||
|
pan1.setBounds(100, 50, 200, 110);
|
||||||
|
pan1.setOpaque(false);
|
||||||
|
pan1.setLayout(new FlowLayout());
|
||||||
|
pan1.add(addFlightBtn);
|
||||||
|
pan1.add(deleteFlightBtn);
|
||||||
|
this.add(pan1);
|
||||||
|
|
||||||
|
//添加航线,删除航线
|
||||||
|
addRouteBtn = new JButton("添加航线", addIco);
|
||||||
|
addRouteBtn.setBorder(null); //取消边框
|
||||||
|
addRouteBtn.setBorder(BorderFactory.createRaisedBevelBorder()); //设置突起
|
||||||
|
|
||||||
|
addRouteBtn.setFont(font2);
|
||||||
|
addRouteBtn.setPreferredSize(new Dimension(150, 50));
|
||||||
|
deleteRouteBtn = new JButton("删除航线", deleteIco);
|
||||||
|
deleteRouteBtn.setBorder(null); //取消边框
|
||||||
|
deleteRouteBtn.setBorder(BorderFactory.createRaisedBevelBorder()); //设置突起
|
||||||
|
|
||||||
|
deleteRouteBtn.setFont(font2);
|
||||||
|
deleteRouteBtn.setPreferredSize(new Dimension(150, 50));
|
||||||
|
|
||||||
|
JPanel pan2 = new JPanel();
|
||||||
|
pan2.setBounds(100, 170, 200, 110);
|
||||||
|
pan2.setOpaque(false);
|
||||||
|
pan2.setLayout(new FlowLayout());
|
||||||
|
pan2.add(addRouteBtn);
|
||||||
|
pan2.add(deleteRouteBtn);
|
||||||
|
this.add(pan2);
|
||||||
|
|
||||||
|
//添加票,删除票
|
||||||
|
addTicketBtn = new JButton("添加机票", addIco);
|
||||||
|
addTicketBtn.setBorder(null); //取消边框
|
||||||
|
addTicketBtn.setBorder(BorderFactory.createRaisedBevelBorder()); //设置突起
|
||||||
|
|
||||||
|
addTicketBtn.setFont(font2);
|
||||||
|
addTicketBtn.setPreferredSize(new Dimension(150, 50));
|
||||||
|
deleteTicketBtn = new JButton("删除机票", deleteIco);
|
||||||
|
deleteTicketBtn.setBorder(null); //取消边框
|
||||||
|
deleteTicketBtn.setBorder(BorderFactory.createRaisedBevelBorder()); //设置突起
|
||||||
|
|
||||||
|
deleteTicketBtn.setFont(font2);
|
||||||
|
deleteTicketBtn.setPreferredSize(new Dimension(150, 50));
|
||||||
|
|
||||||
|
JPanel pan3 = new JPanel();
|
||||||
|
pan3.setBounds(100, 290, 200, 110);
|
||||||
|
pan3.setOpaque(false);
|
||||||
|
pan3.setLayout(new FlowLayout());
|
||||||
|
pan3.add(addTicketBtn);
|
||||||
|
pan3.add(deleteTicketBtn);
|
||||||
|
this.add(pan3);
|
||||||
|
|
||||||
|
deleteUserBtn = new JButton("删除用户", deleteIco);
|
||||||
|
deleteUserBtn.setBorder(null); //取消边框
|
||||||
|
deleteUserBtn.setBorder(BorderFactory.createRaisedBevelBorder()); //设置突起
|
||||||
|
|
||||||
|
deleteUserBtn.setFont(font2);
|
||||||
|
addUserBtn = new JButton("添加用户", addIco);
|
||||||
|
addUserBtn.setBorder(null); //取消边框
|
||||||
|
addUserBtn.setBorder(BorderFactory.createRaisedBevelBorder()); //设置突起
|
||||||
|
addUserBtn.setFont(font2);
|
||||||
|
deleteUserBtn.setPreferredSize(new Dimension(150, 50));
|
||||||
|
addUserBtn.setPreferredSize(new Dimension(150, 50));
|
||||||
|
|
||||||
|
JPanel pan4 = new JPanel();
|
||||||
|
pan4.setBounds(100, 410, 200, 110);
|
||||||
|
pan4.setOpaque(false);
|
||||||
|
pan4.setLayout(new FlowLayout());
|
||||||
|
pan4.add(addUserBtn);
|
||||||
|
pan4.add(deleteUserBtn);
|
||||||
|
this.add(pan4);
|
||||||
|
|
||||||
|
currentFlightBtn = new JButton("当前飞机", currentIco);
|
||||||
|
currentFlightBtn.setBorder(null); //取消边框
|
||||||
|
currentFlightBtn.setBorder(BorderFactory.createRaisedBevelBorder()); //设置突起
|
||||||
|
currentFlightBtn.setFont(font2);
|
||||||
|
currentFlightBtn.setPreferredSize(new Dimension(150, 50));
|
||||||
|
currentRouteBtn = new JButton("当前航线", currentIco);
|
||||||
|
currentRouteBtn.setBorder(null); //取消边框
|
||||||
|
currentRouteBtn.setBorder(BorderFactory.createRaisedBevelBorder()); //设置突起
|
||||||
|
|
||||||
|
currentRouteBtn.setFont(font2);
|
||||||
|
currentRouteBtn.setPreferredSize(new Dimension(150, 50));
|
||||||
|
currentTicketBtn = new JButton("当前机票", currentIco);
|
||||||
|
currentTicketBtn.setBorder(null); //取消边框
|
||||||
|
currentTicketBtn.setBorder(BorderFactory.createRaisedBevelBorder()); //设置突起
|
||||||
|
currentTicketBtn.setFont(font2);
|
||||||
|
currentTicketBtn.setPreferredSize(new Dimension(150, 50));
|
||||||
|
currentUser = new JButton("当前用户", currentIco);
|
||||||
|
currentUser.setBorder(null); //取消边框
|
||||||
|
currentUser.setBorder(BorderFactory.createRaisedBevelBorder()); //设置突起
|
||||||
|
|
||||||
|
currentUser.setFont(font2);
|
||||||
|
currentUser.setPreferredSize(new Dimension(150, 50));
|
||||||
|
currentFlightBtn.setBounds(330, 85, 150, 50);
|
||||||
|
currentRouteBtn.setBounds(330, 205, 150, 50);
|
||||||
|
currentTicketBtn.setBounds(330, 325, 150, 50);
|
||||||
|
currentUser.setBounds(330, 440, 150, 50);
|
||||||
|
|
||||||
|
this.add(currentFlightBtn);
|
||||||
|
this.add(currentRouteBtn);
|
||||||
|
this.add(currentTicketBtn);
|
||||||
|
this.add(currentUser);
|
||||||
|
|
||||||
|
menuBar = new JMenuBar();
|
||||||
|
JMenu help = new JMenu("帮助");
|
||||||
|
helpMenu = new JMenuItem("使用说明");
|
||||||
|
help.add(helpMenu);
|
||||||
|
administrator = new JMenu("管理员");
|
||||||
|
signOut = new JMenuItem("退出登录");
|
||||||
|
currentAdmin = new JMenuItem("当前管理员");
|
||||||
|
administrator.add(currentAdmin);
|
||||||
|
administrator.add(signOut);
|
||||||
|
|
||||||
|
menuBar.add(administrator);
|
||||||
|
menuBar.add(help);
|
||||||
|
|
||||||
|
this.setJMenuBar(menuBar);
|
||||||
|
|
||||||
|
JLabel bottomLab = new JLabel("当前管理员:");
|
||||||
|
bottomLab.setBounds(0, 500, 300, 50);
|
||||||
|
bottomLab.setForeground(Color.WHITE);
|
||||||
|
this.add(bottomLab);
|
||||||
|
|
||||||
|
|
||||||
|
popupMenu = new JPopupMenu();
|
||||||
|
all = new JMenuItem("全选");
|
||||||
|
copy = new JMenuItem("复制");
|
||||||
|
past = new JMenuItem("粘贴");
|
||||||
|
refresh = new JMenuItem("刷新清空");
|
||||||
|
|
||||||
|
shi = new JMenuItem("10");
|
||||||
|
shiwu = new JMenuItem("15");
|
||||||
|
ershi = new JMenuItem("20");
|
||||||
|
erhshiwu = new JMenuItem("25");
|
||||||
|
sanshi = new JMenuItem("30");
|
||||||
|
JMenu fontMenu = new JMenu("设置字体大小");
|
||||||
|
|
||||||
|
blackFont = new JMenuItem("黑色(默认)");
|
||||||
|
redFont = new JMenuItem("红色");
|
||||||
|
blueFont = new JMenuItem("蓝色");
|
||||||
|
yellowFont = new JMenuItem("黄色");
|
||||||
|
greenFont = new JMenuItem("绿色");
|
||||||
|
whiteFont = new JMenuItem("白色");
|
||||||
|
|
||||||
|
JMenu fontColorMenu = new JMenu("设置字体的颜色");
|
||||||
|
fontColorMenu.add(blackFont);
|
||||||
|
fontColorMenu.add(redFont);
|
||||||
|
fontColorMenu.add(yellowFont);
|
||||||
|
fontColorMenu.add(blueFont);
|
||||||
|
fontColorMenu.add(greenFont);
|
||||||
|
fontColorMenu.add(whiteFont);
|
||||||
|
|
||||||
|
fontMenu.add(shi);
|
||||||
|
fontMenu.add(shiwu);
|
||||||
|
fontMenu.add(ershi);
|
||||||
|
fontMenu.add(erhshiwu);
|
||||||
|
fontMenu.add(sanshi);
|
||||||
|
|
||||||
|
popupMenu.add(all);
|
||||||
|
popupMenu.addSeparator(); //分割线
|
||||||
|
popupMenu.add(copy);
|
||||||
|
popupMenu.addSeparator();
|
||||||
|
popupMenu.add(past);
|
||||||
|
popupMenu.addSeparator();
|
||||||
|
popupMenu.add(refresh);
|
||||||
|
popupMenu.addSeparator();
|
||||||
|
popupMenu.add(fontMenu);
|
||||||
|
popupMenu.addSeparator();
|
||||||
|
popupMenu.add(fontColorMenu);
|
||||||
|
|
||||||
|
|
||||||
|
setBounds(300, 150, 1000, 600);
|
||||||
|
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||||
|
setVisible(true);
|
||||||
|
setResizable(false);
|
||||||
|
setTitle(getTitle());
|
||||||
|
|
||||||
|
currentAdmin.addActionListener(this);
|
||||||
|
signOut.addActionListener(this);
|
||||||
|
addFlightBtn.addActionListener(this);
|
||||||
|
deleteFlightBtn.addActionListener(this);
|
||||||
|
addRouteBtn.addActionListener(this);
|
||||||
|
deleteRouteBtn.addActionListener(this);
|
||||||
|
addTicketBtn.addActionListener(this);
|
||||||
|
deleteTicketBtn.addActionListener(this);
|
||||||
|
addUserBtn.addActionListener(this);
|
||||||
|
deleteUserBtn.addActionListener(this);
|
||||||
|
currentFlightBtn.addActionListener(this);
|
||||||
|
currentRouteBtn.addActionListener(this);
|
||||||
|
currentTicketBtn.addActionListener(this);
|
||||||
|
currentUser.addActionListener(this);
|
||||||
|
|
||||||
|
helpMenu.addActionListener(this);
|
||||||
|
|
||||||
|
//右键菜单 设置字体大小
|
||||||
|
shi.addActionListener(this);
|
||||||
|
shiwu.addActionListener(this);
|
||||||
|
ershi.addActionListener(this);
|
||||||
|
erhshiwu.addActionListener(this);
|
||||||
|
sanshi.addActionListener(this);
|
||||||
|
//右键菜单 设置字体颜色
|
||||||
|
blackFont.addActionListener(this);
|
||||||
|
yellowFont.addActionListener(this);
|
||||||
|
redFont.addActionListener(this);
|
||||||
|
blueFont.addActionListener(this);
|
||||||
|
greenFont.addActionListener(this);
|
||||||
|
whiteFont.addActionListener(this);
|
||||||
|
|
||||||
|
//右键菜单-刷新
|
||||||
|
refresh.addActionListener(this);
|
||||||
|
|
||||||
|
//右键菜单 -全选
|
||||||
|
all.addActionListener(this);
|
||||||
|
//右键菜单-复制
|
||||||
|
copy.addActionListener(this);
|
||||||
|
//右键菜单-粘贴
|
||||||
|
past.addActionListener(this);
|
||||||
|
|
||||||
|
//右键菜单
|
||||||
|
showInfo.addMouseListener(new MouseAdapter() {
|
||||||
|
@Override
|
||||||
|
public void mouseClicked(MouseEvent e) {
|
||||||
|
super.mouseClicked(e);
|
||||||
|
if (e.getButton() == MouseEvent.BUTTON3) {
|
||||||
|
popupMenu.show(showInfo, e.getX(), e.getY());
|
||||||
|
}
|
||||||
|
if (e.getButton() == MouseEvent.BUTTON1) {
|
||||||
|
popupMenu.setVisible(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
|
||||||
|
new AdminMainPage();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
if (e.getSource() == currentAdmin) {
|
||||||
|
JOptionPane.showMessageDialog(null, "当前管理员" + AdminUserLogin.usernameTextField.getText());
|
||||||
|
}
|
||||||
|
if (e.getSource() == signOut) {
|
||||||
|
this.dispose();
|
||||||
|
new Login();
|
||||||
|
}
|
||||||
|
if (e.getSource() == addFlightBtn) {
|
||||||
|
new AddFlight();
|
||||||
|
}
|
||||||
|
if (e.getSource() == deleteFlightBtn) {
|
||||||
|
new DeleteFlight();
|
||||||
|
}
|
||||||
|
if (e.getSource() == addRouteBtn) {
|
||||||
|
new AddRoute();
|
||||||
|
}
|
||||||
|
if (e.getSource() == deleteRouteBtn) {
|
||||||
|
new DeleteRoute();
|
||||||
|
}
|
||||||
|
if (e.getSource() == addTicketBtn) {
|
||||||
|
new AddTicket();
|
||||||
|
}
|
||||||
|
if (e.getSource() == deleteTicketBtn) {
|
||||||
|
new DeleteTicket();
|
||||||
|
}
|
||||||
|
if (e.getSource() == addUserBtn) {
|
||||||
|
new AddUser();
|
||||||
|
}
|
||||||
|
if (e.getSource() == deleteUserBtn) {
|
||||||
|
new DeleteUser2();
|
||||||
|
}
|
||||||
|
if (e.getSource() == currentFlightBtn) {
|
||||||
|
|
||||||
|
}
|
||||||
|
if (e.getSource() == currentRouteBtn) {
|
||||||
|
|
||||||
|
}
|
||||||
|
if (e.getSource() == currentTicketBtn) {
|
||||||
|
|
||||||
|
}
|
||||||
|
if (e.getSource() == currentUser) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.getSource() == helpMenu) {
|
||||||
|
JOptionPane.showMessageDialog(null, "欢迎登录飞机订票系统后台管理!\n" +
|
||||||
|
"使用说明:\n" +
|
||||||
|
"1.在进行数据的修改时,请仔细核对信息,以免误删操作.\n" +
|
||||||
|
"2.管理员不可私自篡改数据,发现者,律师函送上.\n" +
|
||||||
|
"3.管理员确保自己在安全的环境下登录后台,以免不法分子,趁机而入.\n" +
|
||||||
|
"4.管理员要对自己做出的一切行为负责.\n" +
|
||||||
|
"感谢使用,祝你使用愉快!");
|
||||||
|
}
|
||||||
|
//右键菜单-设置字体的大小
|
||||||
|
if (e.getSource() == shi) {
|
||||||
|
showInfo.setFont(new Font("楷体", Font.PLAIN, 10));
|
||||||
|
}
|
||||||
|
if (e.getSource() == shiwu) {
|
||||||
|
showInfo.setFont(new Font("楷体", Font.PLAIN, 15));
|
||||||
|
}
|
||||||
|
if (e.getSource() == ershi) {
|
||||||
|
showInfo.setFont(new Font("楷体", Font.PLAIN, 20));
|
||||||
|
}
|
||||||
|
if (e.getSource() == erhshiwu) {
|
||||||
|
showInfo.setFont(new Font("楷体", Font.PLAIN, 25));
|
||||||
|
}
|
||||||
|
if (e.getSource() == sanshi) {
|
||||||
|
showInfo.setFont(new Font("楷体", Font.PLAIN, 30));
|
||||||
|
}
|
||||||
|
//右键菜单-设置字体的颜色
|
||||||
|
if (e.getSource() == blackFont) {
|
||||||
|
showInfo.setForeground(Color.BLACK);
|
||||||
|
}
|
||||||
|
if (e.getSource() == redFont) {
|
||||||
|
showInfo.setForeground(Color.RED);
|
||||||
|
}
|
||||||
|
if (e.getSource() == yellowFont) {
|
||||||
|
showInfo.setForeground(Color.YELLOW);
|
||||||
|
}
|
||||||
|
if (e.getSource() == blueFont) {
|
||||||
|
showInfo.setForeground(Color.CYAN);
|
||||||
|
}
|
||||||
|
if (e.getSource() == greenFont) {
|
||||||
|
showInfo.setForeground(Color.GREEN);
|
||||||
|
}
|
||||||
|
if (e.getSource() == whiteFont) {
|
||||||
|
showInfo.setForeground(Color.LIGHT_GRAY);
|
||||||
|
}
|
||||||
|
if (e.getSource() == refresh) {
|
||||||
|
showInfo.setText("");
|
||||||
|
showInfo.repaint();
|
||||||
|
}
|
||||||
|
// 右键菜单-全选
|
||||||
|
if (e.getSource() == all) {
|
||||||
|
showInfo.selectAll();
|
||||||
|
}
|
||||||
|
//右键菜单 -复制
|
||||||
|
if (e.getSource() == copy) {
|
||||||
|
showInfo.copy();
|
||||||
|
}//右键菜单-粘贴
|
||||||
|
if (e.getSource() == past) {
|
||||||
|
showInfo.paste();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,181 @@
|
|||||||
|
package xjdx.rjxy.airplane.view;
|
||||||
|
|
||||||
|
import javax.swing.*;
|
||||||
|
import java.awt.*;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
import java.awt.event.FocusEvent;
|
||||||
|
import java.awt.event.FocusListener;
|
||||||
|
|
||||||
|
public class AdminUserLogin extends JFrame implements ActionListener {
|
||||||
|
static JTextField usernameTextField;
|
||||||
|
JButton loginBtn, quitBtn, backBtn;
|
||||||
|
JPasswordField passwordField, confirmPasswordField;
|
||||||
|
private Icon loginIco = new ImageIcon("E:\\JavaProjects_IDEA\\Airline Reservation System\\src\\xjdx\\rjxy\\airplane\\view\\images\\登录.png");
|
||||||
|
private Icon registerIco = new ImageIcon("E:\\JavaProjects_IDEA\\Airline Reservation System\\src\\xjdx\\rjxy\\airplane\\view\\images\\工会成员注册.png");
|
||||||
|
private Icon quitIco = new ImageIcon("E:\\JavaProjects_IDEA\\Airline Reservation System\\src\\xjdx\\rjxy\\airplane\\view\\images\\18.退出_关闭.png");
|
||||||
|
|
||||||
|
public AdminUserLogin() {
|
||||||
|
super("飞机订票系统 v1.0>>管理员登录窗口");
|
||||||
|
//改变按钮样式
|
||||||
|
try {
|
||||||
|
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
|
||||||
|
} catch (ClassNotFoundException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (InstantiationException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (UnsupportedLookAndFeelException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
//设置ICO图标
|
||||||
|
Image im;
|
||||||
|
ImageIcon ig = new ImageIcon("E:\\JavaProjects_IDEA\\Airline Reservation System\\src\\xjdx\\rjxy\\airplane\\view\\images\\ico.jpg");//设置图标图片
|
||||||
|
im = ig.getImage();
|
||||||
|
setIconImage(im);
|
||||||
|
//设置背景图
|
||||||
|
ImageIcon icon = new ImageIcon("E:\\JavaProjects_IDEA\\Airline Reservation System\\src\\xjdx\\rjxy\\airplane\\view\\images\\AdminBackGround.jpg");//背景图
|
||||||
|
JLabel label = new JLabel(icon);//标签中加入图片
|
||||||
|
label.setBounds(0, 0, icon.getIconWidth(), icon.getIconHeight());//设置标签位置大小为图片大小
|
||||||
|
getLayeredPane().add(label, Integer.valueOf(Integer.MIN_VALUE));//标签添加到第二层面板
|
||||||
|
//获取顶层容器设为透明
|
||||||
|
JPanel Panel = (JPanel) getContentPane();
|
||||||
|
Panel.setOpaque(false);
|
||||||
|
getContentPane().setLayout(null);
|
||||||
|
|
||||||
|
JPanel titlePan = new JPanel();
|
||||||
|
titlePan.setOpaque(false);
|
||||||
|
JLabel titleLab = new JLabel("Airline Reservation System");
|
||||||
|
titlePan.setBounds(0, 50, 600, 55);
|
||||||
|
|
||||||
|
Font font = new Font("楷体", Font.TYPE1_FONT, 30);
|
||||||
|
titleLab.setFont(font);
|
||||||
|
titleLab.setForeground(Color.WHITE);
|
||||||
|
|
||||||
|
titlePan.add(titleLab);
|
||||||
|
getContentPane().add(titlePan);
|
||||||
|
|
||||||
|
JPanel pan1 = new JPanel();
|
||||||
|
pan1.setOpaque(false);
|
||||||
|
JLabel usernameLab = new JLabel("AdminUsername:");
|
||||||
|
JLabel passwordLab = new JLabel("AdminPassword:");
|
||||||
|
JLabel confirmPassword = new JLabel("Confirm P W D:");
|
||||||
|
|
||||||
|
Font font1 = new Font("楷体", Font.TYPE1_FONT, 20);
|
||||||
|
usernameLab.setFont(font1);
|
||||||
|
passwordLab.setFont(font1);
|
||||||
|
confirmPassword.setFont(font1);
|
||||||
|
usernameLab.setForeground(Color.BLACK);
|
||||||
|
passwordLab.setForeground(Color.BLACK);
|
||||||
|
confirmPassword.setForeground(Color.black);
|
||||||
|
pan1.setBounds(140, 120, 150, 150);
|
||||||
|
pan1.add(usernameLab);
|
||||||
|
pan1.add(passwordLab);
|
||||||
|
pan1.add(confirmPassword);
|
||||||
|
pan1.setLayout(new FlowLayout(0, 0, 20));
|
||||||
|
getContentPane().add(pan1);
|
||||||
|
|
||||||
|
|
||||||
|
JPanel pan2 = new JPanel();
|
||||||
|
pan2.setOpaque(false);
|
||||||
|
usernameTextField = new JTextField(28);
|
||||||
|
usernameTextField.setToolTipText("please enter AdminUsername");
|
||||||
|
passwordField = new JPasswordField(28);
|
||||||
|
passwordField.setOpaque(false);
|
||||||
|
usernameTextField.setOpaque(false);
|
||||||
|
passwordField.setToolTipText("please enter AdminPassword");
|
||||||
|
|
||||||
|
confirmPasswordField = new JPasswordField(28);
|
||||||
|
confirmPasswordField.setOpaque(false);
|
||||||
|
confirmPasswordField.setToolTipText("please enter AdminPassword again");
|
||||||
|
pan2.setBounds(300, 120, 200, 150);
|
||||||
|
pan2.add(usernameTextField);
|
||||||
|
pan2.add(passwordField);
|
||||||
|
pan2.add(confirmPasswordField);
|
||||||
|
pan2.setLayout(new FlowLayout(0, 0, 23));
|
||||||
|
getContentPane().add(pan2);
|
||||||
|
|
||||||
|
|
||||||
|
JPanel pan3 = new JPanel();
|
||||||
|
pan3.setOpaque(false);
|
||||||
|
loginBtn = new JButton("Login");
|
||||||
|
loginBtn.setIcon(loginIco);
|
||||||
|
quitBtn = new JButton("Quit");
|
||||||
|
quitBtn.setIcon(quitIco);
|
||||||
|
|
||||||
|
pan3.setBounds(150, 300, 300, 50);
|
||||||
|
pan3.setLayout(new FlowLayout(0, 50, 0));
|
||||||
|
pan3.add(loginBtn);
|
||||||
|
pan3.add(quitBtn);
|
||||||
|
|
||||||
|
getContentPane().add(pan3);
|
||||||
|
|
||||||
|
backBtn = new JButton("<<");
|
||||||
|
backBtn.setFont(font);
|
||||||
|
backBtn.setBounds(0, 0, 70, 30);
|
||||||
|
backBtn.setContentAreaFilled(false); //设置按钮透明
|
||||||
|
backBtn.setBorder(null); //取消边框
|
||||||
|
this.add(backBtn);
|
||||||
|
|
||||||
|
|
||||||
|
setBounds(500, 200, 600, 500);
|
||||||
|
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
|
||||||
|
setVisible(true);
|
||||||
|
setResizable(false);
|
||||||
|
setTitle(getTitle());
|
||||||
|
|
||||||
|
loginBtn.addActionListener(this);
|
||||||
|
quitBtn.addActionListener(this);
|
||||||
|
backBtn.addActionListener(this);
|
||||||
|
|
||||||
|
usernameTextField.setText("AdminUsername and password");
|
||||||
|
usernameTextField.setForeground(new Color(204, 204, 204));
|
||||||
|
usernameTextField.addFocusListener(new FocusListener() {
|
||||||
|
@Override
|
||||||
|
public void focusGained(FocusEvent e) {
|
||||||
|
if (usernameTextField.getText().equals("AdminUsername and password")) {
|
||||||
|
usernameTextField.setText("");
|
||||||
|
usernameTextField.setForeground(Color.BLACK);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void focusLost(FocusEvent e) {
|
||||||
|
if (usernameTextField.getText().length() < 1) {
|
||||||
|
usernameTextField.setText("AdminUsername and password");
|
||||||
|
usernameTextField.setForeground(new Color(160, 157, 157));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
new AdminUserLogin();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
if (e.getSource() == quitBtn) {
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
if (e.getSource() == loginBtn) {
|
||||||
|
String username = usernameTextField.getText();
|
||||||
|
String password = String.valueOf(passwordField.getPassword());
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
if (e.getSource() == backBtn) {
|
||||||
|
new Login();
|
||||||
|
this.dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@@ -0,0 +1,101 @@
|
|||||||
|
package xjdx.rjxy.airplane.view;
|
||||||
|
|
||||||
|
import javax.swing.*;
|
||||||
|
import java.awt.*;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
|
||||||
|
public class DeleteFlight extends JFrame implements ActionListener {
|
||||||
|
JTextField typeField;
|
||||||
|
JButton backBtn, okBtn;
|
||||||
|
|
||||||
|
public DeleteFlight() {
|
||||||
|
super("飞机订票系统后台管理 v1.0>>删除飞机");
|
||||||
|
//改变按钮样式
|
||||||
|
try {
|
||||||
|
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
|
||||||
|
} catch (ClassNotFoundException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (InstantiationException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (UnsupportedLookAndFeelException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
//设置ICO图标
|
||||||
|
Image im;
|
||||||
|
ImageIcon ig = new ImageIcon("E:\\JavaProjects_IDEA\\Airline Reservation System\\src\\xjdx\\rjxy\\airplane\\view\\images\\ico.jpg");//设置图标图片
|
||||||
|
im = ig.getImage();
|
||||||
|
setIconImage(im);
|
||||||
|
//设置背景图
|
||||||
|
ImageIcon icon = new ImageIcon("E:\\JavaProjects_IDEA\\Airline Reservation System\\src\\xjdx\\rjxy\\airplane\\view\\images\\AdminBackGround.jpg");//背景图
|
||||||
|
JLabel label = new JLabel(icon);//标签中加入图片
|
||||||
|
label.setBounds(0, 0, icon.getIconWidth(), icon.getIconHeight());//设置标签位置大小为图片大小
|
||||||
|
getLayeredPane().add(label, Integer.valueOf(Integer.MIN_VALUE));//标签添加到第二层面板
|
||||||
|
//获取顶层容器设为透明
|
||||||
|
JPanel Panel = (JPanel) getContentPane();
|
||||||
|
Panel.setOpaque(false);
|
||||||
|
getContentPane().setLayout(null);
|
||||||
|
|
||||||
|
Font font = new Font("楷体", Font.TYPE1_FONT, 20);
|
||||||
|
|
||||||
|
JLabel typeLab = new JLabel("飞机型号:");
|
||||||
|
typeLab.setFont(font);
|
||||||
|
|
||||||
|
JPanel panel = new JPanel();
|
||||||
|
panel.setBounds(50, 90, 100, 100);
|
||||||
|
panel.setOpaque(false);
|
||||||
|
panel.setLayout(new FlowLayout());
|
||||||
|
panel.add(typeLab);
|
||||||
|
|
||||||
|
this.add(panel);
|
||||||
|
|
||||||
|
typeField = new JTextField(25);
|
||||||
|
|
||||||
|
JPanel panel1 = new JPanel();
|
||||||
|
panel1.setBounds(150, 90, 160, 100);
|
||||||
|
panel1.setOpaque(false);
|
||||||
|
panel1.setLayout(new FlowLayout(0, 0, 7));
|
||||||
|
panel1.add(typeField);
|
||||||
|
this.add(panel1);
|
||||||
|
|
||||||
|
|
||||||
|
okBtn = new JButton("删除");
|
||||||
|
okBtn.setFont(font);
|
||||||
|
okBtn.setBounds(155, 180, 80, 40);
|
||||||
|
okBtn.setBorder(null); //取消边框
|
||||||
|
okBtn.setBorder(BorderFactory.createRaisedBevelBorder()); //设置突起
|
||||||
|
this.add(okBtn);
|
||||||
|
|
||||||
|
backBtn = new JButton("<<");
|
||||||
|
backBtn.setFont(font);
|
||||||
|
backBtn.setBounds(0, 0, 70, 30);
|
||||||
|
backBtn.setContentAreaFilled(false); //设置按钮透明
|
||||||
|
backBtn.setBorder(null); //取消边框
|
||||||
|
this.add(backBtn);
|
||||||
|
|
||||||
|
setBounds(600, 300, 400, 300);
|
||||||
|
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||||
|
setVisible(true);
|
||||||
|
setResizable(false);
|
||||||
|
setTitle(getTitle());
|
||||||
|
|
||||||
|
okBtn.addActionListener(this);
|
||||||
|
backBtn.addActionListener(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
new DeleteFlight();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
if (e.getSource() == backBtn) {
|
||||||
|
this.dispose();
|
||||||
|
}
|
||||||
|
if (e.getSource() == okBtn) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,101 @@
|
|||||||
|
package xjdx.rjxy.airplane.view;
|
||||||
|
|
||||||
|
import javax.swing.*;
|
||||||
|
import java.awt.*;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
|
||||||
|
public class DeleteRoute extends JFrame implements ActionListener {
|
||||||
|
JTextField typeField;
|
||||||
|
JButton backBtn, okBtn;
|
||||||
|
|
||||||
|
public DeleteRoute() {
|
||||||
|
super("飞机订票系统后台管理 v1.0>>删除航线");
|
||||||
|
//改变按钮样式
|
||||||
|
try {
|
||||||
|
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
|
||||||
|
} catch (ClassNotFoundException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (InstantiationException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (UnsupportedLookAndFeelException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
//设置ICO图标
|
||||||
|
Image im;
|
||||||
|
ImageIcon ig = new ImageIcon("E:\\JavaProjects_IDEA\\Airline Reservation System\\src\\xjdx\\rjxy\\airplane\\view\\images\\ico.jpg");//设置图标图片
|
||||||
|
im = ig.getImage();
|
||||||
|
setIconImage(im);
|
||||||
|
//设置背景图
|
||||||
|
ImageIcon icon = new ImageIcon("E:\\JavaProjects_IDEA\\Airline Reservation System\\src\\xjdx\\rjxy\\airplane\\view\\images\\AdminBackGround.jpg");//背景图
|
||||||
|
JLabel label = new JLabel(icon);//标签中加入图片
|
||||||
|
label.setBounds(0, 0, icon.getIconWidth(), icon.getIconHeight());//设置标签位置大小为图片大小
|
||||||
|
getLayeredPane().add(label, Integer.valueOf(Integer.MIN_VALUE));//标签添加到第二层面板
|
||||||
|
//获取顶层容器设为透明
|
||||||
|
JPanel Panel = (JPanel) getContentPane();
|
||||||
|
Panel.setOpaque(false);
|
||||||
|
getContentPane().setLayout(null);
|
||||||
|
|
||||||
|
Font font = new Font("楷体", Font.TYPE1_FONT, 20);
|
||||||
|
|
||||||
|
JLabel typeLab = new JLabel("航线编号:");
|
||||||
|
typeLab.setFont(font);
|
||||||
|
|
||||||
|
JPanel panel = new JPanel();
|
||||||
|
panel.setBounds(50, 90, 100, 100);
|
||||||
|
panel.setOpaque(false);
|
||||||
|
panel.setLayout(new FlowLayout());
|
||||||
|
panel.add(typeLab);
|
||||||
|
|
||||||
|
this.add(panel);
|
||||||
|
|
||||||
|
typeField = new JTextField(25);
|
||||||
|
|
||||||
|
JPanel panel1 = new JPanel();
|
||||||
|
panel1.setBounds(150, 90, 160, 100);
|
||||||
|
panel1.setOpaque(false);
|
||||||
|
panel1.setLayout(new FlowLayout(0, 0, 7));
|
||||||
|
panel1.add(typeField);
|
||||||
|
this.add(panel1);
|
||||||
|
|
||||||
|
|
||||||
|
okBtn = new JButton("删除");
|
||||||
|
okBtn.setFont(font);
|
||||||
|
okBtn.setBounds(155, 180, 80, 40);
|
||||||
|
okBtn.setBorder(null); //取消边框
|
||||||
|
okBtn.setBorder(BorderFactory.createRaisedBevelBorder()); //设置突起
|
||||||
|
this.add(okBtn);
|
||||||
|
|
||||||
|
backBtn = new JButton("<<");
|
||||||
|
backBtn.setFont(font);
|
||||||
|
backBtn.setBounds(0, 0, 70, 30);
|
||||||
|
backBtn.setContentAreaFilled(false); //设置按钮透明
|
||||||
|
backBtn.setBorder(null); //取消边框
|
||||||
|
this.add(backBtn);
|
||||||
|
|
||||||
|
setBounds(600, 300, 400, 300);
|
||||||
|
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||||
|
setVisible(true);
|
||||||
|
setResizable(false);
|
||||||
|
setTitle(getTitle());
|
||||||
|
|
||||||
|
okBtn.addActionListener(this);
|
||||||
|
backBtn.addActionListener(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
new DeleteRoute();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
if (e.getSource() == backBtn) {
|
||||||
|
this.dispose();
|
||||||
|
}
|
||||||
|
if (e.getSource() == okBtn) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,101 @@
|
|||||||
|
package xjdx.rjxy.airplane.view;
|
||||||
|
|
||||||
|
import javax.swing.*;
|
||||||
|
import java.awt.*;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
|
||||||
|
public class DeleteTicket extends JFrame implements ActionListener {
|
||||||
|
JTextField typeField;
|
||||||
|
JButton backBtn, okBtn;
|
||||||
|
|
||||||
|
public DeleteTicket() {
|
||||||
|
super("飞机订票系统后台管理 v1.0>>删除机票");
|
||||||
|
//改变按钮样式
|
||||||
|
try {
|
||||||
|
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
|
||||||
|
} catch (ClassNotFoundException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (InstantiationException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (UnsupportedLookAndFeelException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
//设置ICO图标
|
||||||
|
Image im;
|
||||||
|
ImageIcon ig = new ImageIcon("E:\\JavaProjects_IDEA\\Airline Reservation System\\src\\xjdx\\rjxy\\airplane\\view\\images\\ico.jpg");//设置图标图片
|
||||||
|
im = ig.getImage();
|
||||||
|
setIconImage(im);
|
||||||
|
//设置背景图
|
||||||
|
ImageIcon icon = new ImageIcon("E:\\JavaProjects_IDEA\\Airline Reservation System\\src\\xjdx\\rjxy\\airplane\\view\\images\\AdminBackGround.jpg");//背景图
|
||||||
|
JLabel label = new JLabel(icon);//标签中加入图片
|
||||||
|
label.setBounds(0, 0, icon.getIconWidth(), icon.getIconHeight());//设置标签位置大小为图片大小
|
||||||
|
getLayeredPane().add(label, Integer.valueOf(Integer.MIN_VALUE));//标签添加到第二层面板
|
||||||
|
//获取顶层容器设为透明
|
||||||
|
JPanel Panel = (JPanel) getContentPane();
|
||||||
|
Panel.setOpaque(false);
|
||||||
|
getContentPane().setLayout(null);
|
||||||
|
|
||||||
|
Font font = new Font("楷体", Font.TYPE1_FONT, 20);
|
||||||
|
|
||||||
|
JLabel typeLab = new JLabel("机票编号:");
|
||||||
|
typeLab.setFont(font);
|
||||||
|
|
||||||
|
JPanel panel = new JPanel();
|
||||||
|
panel.setBounds(50, 90, 100, 100);
|
||||||
|
panel.setOpaque(false);
|
||||||
|
panel.setLayout(new FlowLayout());
|
||||||
|
panel.add(typeLab);
|
||||||
|
|
||||||
|
this.add(panel);
|
||||||
|
|
||||||
|
typeField = new JTextField(25);
|
||||||
|
|
||||||
|
JPanel panel1 = new JPanel();
|
||||||
|
panel1.setBounds(150, 90, 160, 100);
|
||||||
|
panel1.setOpaque(false);
|
||||||
|
panel1.setLayout(new FlowLayout(0, 0, 7));
|
||||||
|
panel1.add(typeField);
|
||||||
|
this.add(panel1);
|
||||||
|
|
||||||
|
|
||||||
|
okBtn = new JButton("删除");
|
||||||
|
okBtn.setFont(font);
|
||||||
|
okBtn.setBounds(155, 180, 80, 40);
|
||||||
|
okBtn.setBorder(null); //取消边框
|
||||||
|
okBtn.setBorder(BorderFactory.createRaisedBevelBorder()); //设置突起
|
||||||
|
this.add(okBtn);
|
||||||
|
|
||||||
|
backBtn = new JButton("<<");
|
||||||
|
backBtn.setFont(font);
|
||||||
|
backBtn.setBounds(0, 0, 70, 30);
|
||||||
|
backBtn.setContentAreaFilled(false); //设置按钮透明
|
||||||
|
backBtn.setBorder(null); //取消边框
|
||||||
|
this.add(backBtn);
|
||||||
|
|
||||||
|
setBounds(600, 300, 400, 300);
|
||||||
|
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||||
|
setVisible(true);
|
||||||
|
setResizable(false);
|
||||||
|
setTitle(getTitle());
|
||||||
|
|
||||||
|
okBtn.addActionListener(this);
|
||||||
|
backBtn.addActionListener(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
new DeleteTicket();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
if (e.getSource() == backBtn) {
|
||||||
|
this.dispose();
|
||||||
|
}
|
||||||
|
if (e.getSource() == okBtn) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,120 @@
|
|||||||
|
package xjdx.rjxy.airplane.view;
|
||||||
|
|
||||||
|
import javax.swing.*;
|
||||||
|
import java.awt.*;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
|
||||||
|
public class DeleteUser extends JFrame implements ActionListener {
|
||||||
|
JTextField nameTextField, passwordTextField, repasswordTextField;
|
||||||
|
JButton backBtn, OKBtn;
|
||||||
|
private Icon okBtnIco = new ImageIcon("E:\\JavaProjects_IDEA\\Airline Reservation System\\src\\xjdx\\rjxy\\airplane\\view\\images\\OK.png");
|
||||||
|
|
||||||
|
public DeleteUser() {
|
||||||
|
super("飞机订票系统 v1.0>>账号注销");
|
||||||
|
//改变按钮样式
|
||||||
|
try {
|
||||||
|
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
|
||||||
|
} catch (ClassNotFoundException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (InstantiationException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (UnsupportedLookAndFeelException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
//设置ICO图标
|
||||||
|
Image im;
|
||||||
|
ImageIcon ig = new ImageIcon("E:\\JavaProjects_IDEA\\Airline Reservation System\\src\\xjdx\\rjxy\\airplane\\view\\images\\ico.jpg");//设置图标图片
|
||||||
|
im = ig.getImage();
|
||||||
|
setIconImage(im);
|
||||||
|
//设置背景图
|
||||||
|
ImageIcon icon = new ImageIcon("E:\\JavaProjects_IDEA\\Airline Reservation System\\src\\xjdx\\rjxy\\airplane\\view\\images\\airplane2.png");//背景图
|
||||||
|
JLabel label = new JLabel(icon);//标签中加入图片
|
||||||
|
label.setBounds(0, 0, icon.getIconWidth(), icon.getIconHeight());//设置标签位置大小为图片大小
|
||||||
|
getLayeredPane().add(label, Integer.valueOf(Integer.MIN_VALUE));//标签添加到第二层面板
|
||||||
|
//获取顶层容器设为透明
|
||||||
|
JPanel Panel = (JPanel) getContentPane();
|
||||||
|
Panel.setOpaque(false);
|
||||||
|
getContentPane().setLayout(null);
|
||||||
|
|
||||||
|
Font font = new Font("楷体", Font.TYPE1_FONT, 20);
|
||||||
|
JLabel label1 = new JLabel("请输入以下信息:");
|
||||||
|
label1.setFont(font);
|
||||||
|
label1.setForeground(Color.red);
|
||||||
|
label1.setBounds(0, 20, 180, 30);
|
||||||
|
this.add(label1);
|
||||||
|
|
||||||
|
JLabel nameLab = new JLabel("用 户 名:");
|
||||||
|
nameLab.setFont(font);
|
||||||
|
JLabel idCardLab = new JLabel("密 码:");
|
||||||
|
idCardLab.setFont(font);
|
||||||
|
JLabel flightNumberLab = new JLabel("确认密码:");
|
||||||
|
flightNumberLab.setFont(font);
|
||||||
|
|
||||||
|
nameTextField = new JTextField(27);
|
||||||
|
passwordTextField = new JTextField(27);
|
||||||
|
repasswordTextField = new JTextField(27);
|
||||||
|
|
||||||
|
JPanel pan1 = new JPanel();
|
||||||
|
pan1.setBounds(50, 70, 100, 100);
|
||||||
|
pan1.setOpaque(false);
|
||||||
|
pan1.add(nameLab);
|
||||||
|
pan1.add(idCardLab);
|
||||||
|
pan1.add(flightNumberLab);
|
||||||
|
this.add(pan1);
|
||||||
|
|
||||||
|
JPanel pan2 = new JPanel();
|
||||||
|
pan2.setBounds(155, 70, 200, 100);
|
||||||
|
pan2.setOpaque(false);
|
||||||
|
pan2.setLayout(new FlowLayout(0, 0, 7));
|
||||||
|
pan2.add(nameTextField);
|
||||||
|
pan2.add(passwordTextField);
|
||||||
|
pan2.add(repasswordTextField);
|
||||||
|
this.add(pan2);
|
||||||
|
|
||||||
|
OKBtn = new JButton(okBtnIco);
|
||||||
|
OKBtn.setBounds(125, 185, 150, 30);
|
||||||
|
OKBtn.setFont(font);
|
||||||
|
this.add(OKBtn);
|
||||||
|
|
||||||
|
|
||||||
|
backBtn = new JButton("<<");
|
||||||
|
backBtn.setFont(font);
|
||||||
|
backBtn.setBounds(0, 0, 70, 30);
|
||||||
|
backBtn.setContentAreaFilled(false); //设置按钮透明
|
||||||
|
backBtn.setBorder(null); //取消边框
|
||||||
|
this.add(backBtn);
|
||||||
|
|
||||||
|
setBounds(600, 300, 400, 300);
|
||||||
|
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||||
|
setVisible(true);
|
||||||
|
setResizable(false);
|
||||||
|
setTitle(getTitle());
|
||||||
|
|
||||||
|
backBtn.addActionListener(this);
|
||||||
|
OKBtn.addActionListener(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
new DeleteUser();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
if (e.getSource() == backBtn) {
|
||||||
|
this.dispose();
|
||||||
|
new MainPage();
|
||||||
|
}
|
||||||
|
if (e.getSource() == OKBtn) {
|
||||||
|
int res = JOptionPane.showConfirmDialog(null, "是否确认注销,注销后账号的信息以及记录都会被删除!", "提示", JOptionPane.YES_OPTION);
|
||||||
|
if (res == JOptionPane.YES_OPTION) {
|
||||||
|
//确认注销后执行的操作
|
||||||
|
|
||||||
|
this.dispose();
|
||||||
|
new Login();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,114 @@
|
|||||||
|
package xjdx.rjxy.airplane.view;
|
||||||
|
|
||||||
|
import javax.swing.*;
|
||||||
|
import java.awt.*;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
|
||||||
|
public class DeleteUser2 extends JFrame implements ActionListener {
|
||||||
|
String year[] = {null, "2022", "2023", "2024"};
|
||||||
|
String month[] = {null, "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"};
|
||||||
|
String day[] = {null, "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"};
|
||||||
|
String clock[] = {null, "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "00"};
|
||||||
|
String minute[] = {null, "0", "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", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50,", "51", "52", "53", "54", "55", "56", "57", "58", "59", "60"};
|
||||||
|
JComboBox yearBox, monthBox, dayBox, clockBox, minuteBox;
|
||||||
|
JTextField nameField, rpasswordField;
|
||||||
|
JButton backBtn, okBtn;
|
||||||
|
|
||||||
|
public DeleteUser2() {
|
||||||
|
super("飞机订票系统后台管理 v1.0>>删除用户");
|
||||||
|
//改变按钮样式
|
||||||
|
try {
|
||||||
|
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
|
||||||
|
} catch (ClassNotFoundException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (InstantiationException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (UnsupportedLookAndFeelException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
//设置ICO图标
|
||||||
|
Image im;
|
||||||
|
ImageIcon ig = new ImageIcon("E:\\JavaProjects_IDEA\\Airline Reservation System\\src\\xjdx\\rjxy\\airplane\\view\\images\\ico.jpg");//设置图标图片
|
||||||
|
im = ig.getImage();
|
||||||
|
setIconImage(im);
|
||||||
|
//设置背景图
|
||||||
|
ImageIcon icon = new ImageIcon("E:\\JavaProjects_IDEA\\Airline Reservation System\\src\\xjdx\\rjxy\\airplane\\view\\images\\AdminBackGround.jpg");//背景图
|
||||||
|
JLabel label = new JLabel(icon);//标签中加入图片
|
||||||
|
label.setBounds(0, 0, icon.getIconWidth(), icon.getIconHeight());//设置标签位置大小为图片大小
|
||||||
|
getLayeredPane().add(label, Integer.valueOf(Integer.MIN_VALUE));//标签添加到第二层面板
|
||||||
|
//获取顶层容器设为透明
|
||||||
|
JPanel Panel = (JPanel) getContentPane();
|
||||||
|
Panel.setOpaque(false);
|
||||||
|
getContentPane().setLayout(null);
|
||||||
|
|
||||||
|
Font font = new Font("楷体", Font.TYPE1_FONT, 20);
|
||||||
|
|
||||||
|
JLabel nameLab = new JLabel("用户名:");
|
||||||
|
nameLab.setFont(font);
|
||||||
|
JLabel passwordLab = new JLabel("密 码:");
|
||||||
|
passwordLab.setFont(font);
|
||||||
|
|
||||||
|
|
||||||
|
JPanel panel = new JPanel();
|
||||||
|
panel.setBounds(50, 70, 100, 100);
|
||||||
|
panel.setOpaque(false);
|
||||||
|
panel.setLayout(new FlowLayout());
|
||||||
|
panel.add(nameLab);
|
||||||
|
panel.add(passwordLab);
|
||||||
|
|
||||||
|
this.add(panel);
|
||||||
|
|
||||||
|
nameField = new JTextField(25);
|
||||||
|
rpasswordField = new JTextField(25);
|
||||||
|
|
||||||
|
JPanel panel1 = new JPanel();
|
||||||
|
panel1.setBounds(150, 70, 160, 100);
|
||||||
|
panel1.setOpaque(false);
|
||||||
|
panel1.setLayout(new FlowLayout(0, 0, 7));
|
||||||
|
panel1.add(nameField);
|
||||||
|
panel1.add(rpasswordField);
|
||||||
|
|
||||||
|
this.add(panel1);
|
||||||
|
|
||||||
|
|
||||||
|
okBtn = new JButton("删除");
|
||||||
|
okBtn.setFont(font);
|
||||||
|
okBtn.setBounds(155, 180, 80, 40);
|
||||||
|
okBtn.setBorder(null); //取消边框
|
||||||
|
okBtn.setBorder(BorderFactory.createRaisedBevelBorder()); //设置突起
|
||||||
|
this.add(okBtn);
|
||||||
|
|
||||||
|
backBtn = new JButton("<<");
|
||||||
|
backBtn.setFont(font);
|
||||||
|
backBtn.setBounds(0, 0, 70, 30);
|
||||||
|
backBtn.setContentAreaFilled(false); //设置按钮透明
|
||||||
|
backBtn.setBorder(null); //取消边框
|
||||||
|
this.add(backBtn);
|
||||||
|
|
||||||
|
setBounds(600, 300, 400, 300);
|
||||||
|
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||||
|
setVisible(true);
|
||||||
|
setResizable(false);
|
||||||
|
setTitle(getTitle());
|
||||||
|
|
||||||
|
okBtn.addActionListener(this);
|
||||||
|
backBtn.addActionListener(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
new DeleteUser();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
if (e.getSource() == backBtn) {
|
||||||
|
this.dispose();
|
||||||
|
}
|
||||||
|
if (e.getSource() == okBtn) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -13,11 +13,12 @@ import static xjdx.rjxy.airplane.service.UserService.UserLogin;
|
|||||||
|
|
||||||
public class Login extends JFrame implements ActionListener {
|
public class Login extends JFrame implements ActionListener {
|
||||||
static JTextField usernameTextField;
|
static JTextField usernameTextField;
|
||||||
JButton loginBtn, registerBtn, quitBtn;
|
JButton loginBtn, registerBtn, quitBtn, adminLoginBtn;
|
||||||
JPasswordField passwordField;
|
JPasswordField passwordField;
|
||||||
private Icon loginIco = new ImageIcon("E:\\JavaProjects_IDEA\\Airline Reservation System\\src\\xjdx\\rjxy\\airplane\\view\\images\\登录.png");
|
private Icon loginIco = new ImageIcon("E:\\JavaProjects_IDEA\\Airline Reservation System\\src\\xjdx\\rjxy\\airplane\\view\\images\\登录.png");
|
||||||
private Icon registerIco = new ImageIcon("E:\\JavaProjects_IDEA\\Airline Reservation System\\src\\xjdx\\rjxy\\airplane\\view\\images\\工会成员注册.png");
|
private Icon registerIco = new ImageIcon("E:\\JavaProjects_IDEA\\Airline Reservation System\\src\\xjdx\\rjxy\\airplane\\view\\images\\工会成员注册.png");
|
||||||
private Icon quitIco = new ImageIcon("E:\\JavaProjects_IDEA\\Airline Reservation System\\src\\xjdx\\rjxy\\airplane\\view\\images\\18.退出_关闭.png");
|
private Icon quitIco = new ImageIcon("E:\\JavaProjects_IDEA\\Airline Reservation System\\src\\xjdx\\rjxy\\airplane\\view\\images\\18.退出_关闭.png");
|
||||||
|
private Icon adminBtnIco = new ImageIcon("E:\\JavaProjects_IDEA\\Airline Reservation System\\src\\xjdx\\rjxy\\airplane\\view\\images\\管理员 (1).png");
|
||||||
|
|
||||||
public Login() {
|
public Login() {
|
||||||
super("飞机订票系统 v1.0>>登录窗口");
|
super("飞机订票系统 v1.0>>登录窗口");
|
||||||
@@ -109,6 +110,14 @@ public class Login extends JFrame implements ActionListener {
|
|||||||
|
|
||||||
getContentPane().add(pan3);
|
getContentPane().add(pan3);
|
||||||
|
|
||||||
|
//adminLogin
|
||||||
|
adminLoginBtn = new JButton(adminBtnIco);
|
||||||
|
adminLoginBtn.setBounds(10, 10, 30, 30);
|
||||||
|
adminLoginBtn.setContentAreaFilled(false); //设置按钮透明
|
||||||
|
adminLoginBtn.setBorder(null); //取消边框
|
||||||
|
// adminLoginBtn.setBorder(BorderFactory.createRaisedBevelBorder()); //设置突起
|
||||||
|
this.add(adminLoginBtn);
|
||||||
|
|
||||||
|
|
||||||
setBounds(500, 200, 600, 500);
|
setBounds(500, 200, 600, 500);
|
||||||
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
|
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
|
||||||
@@ -119,6 +128,7 @@ public class Login extends JFrame implements ActionListener {
|
|||||||
registerBtn.addActionListener(this);
|
registerBtn.addActionListener(this);
|
||||||
loginBtn.addActionListener(this);
|
loginBtn.addActionListener(this);
|
||||||
quitBtn.addActionListener(this);
|
quitBtn.addActionListener(this);
|
||||||
|
adminLoginBtn.addActionListener(this);
|
||||||
|
|
||||||
usernameTextField.setText("enter username,password");
|
usernameTextField.setText("enter username,password");
|
||||||
usernameTextField.setForeground(new Color(204, 204, 204));
|
usernameTextField.setForeground(new Color(204, 204, 204));
|
||||||
@@ -148,10 +158,6 @@ public class Login extends JFrame implements ActionListener {
|
|||||||
Login app = new Login();
|
Login app = new Login();
|
||||||
}
|
}
|
||||||
|
|
||||||
// //返回当前登录的用户名
|
|
||||||
// public static String currentUser() {
|
|
||||||
// return currentUsername;
|
|
||||||
// }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
@@ -171,6 +177,10 @@ public class Login extends JFrame implements ActionListener {
|
|||||||
new MainPage();
|
new MainPage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (e.getSource() == adminLoginBtn) {
|
||||||
|
new AdminUserLogin();
|
||||||
|
this.dispose();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -31,9 +31,9 @@ public class MainPage extends JFrame implements ActionListener {
|
|||||||
String minute[] = {null, "0", "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", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50,", "51", "52", "53", "54", "55", "56", "57", "58", "59", "60"};
|
String minute[] = {null, "0", "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", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50,", "51", "52", "53", "54", "55", "56", "57", "58", "59", "60"};
|
||||||
|
|
||||||
String cityList[] = {null, "--请选择城市--", "北京市", "天津市", "上海市", "重庆市", "河北省", "山西省", "辽宁省", "吉林省", "黑龙江省", "江苏省", "浙江省", "安徽省", "福建省", "江西省", "山东省", "河南省", "湖北省", "湖南省", "广东省", "海南省", "四川省", "贵州省", "云南省", "陕西省", "甘肃省", "青海省", "台湾省", "内蒙古自治区", "广西壮族自治区", "西藏自治区", "宁夏回族自治区", "新疆维吾尔自治区", "香港特别行政区", "澳门特别行政区"};
|
String cityList[] = {null, "--请选择城市--", "北京市", "天津市", "上海市", "重庆市", "河北省", "山西省", "辽宁省", "吉林省", "黑龙江省", "江苏省", "浙江省", "安徽省", "福建省", "江西省", "山东省", "河南省", "湖北省", "湖南省", "广东省", "海南省", "四川省", "贵州省", "云南省", "陕西省", "甘肃省", "青海省", "台湾省", "内蒙古自治区", "广西壮族自治区", "西藏自治区", "宁夏回族自治区", "新疆维吾尔自治区", "香港特别行政区", "澳门特别行政区"};
|
||||||
JCheckBox checkBox1, checkBox2, checkBox3, checkBox4;
|
JCheckBox checkBox1, checkBox2, checkBox3;
|
||||||
JLabel titleLab;
|
JLabel titleLab;
|
||||||
JMenuItem all, copy, past, refresh, shi, shiwu, ershi, erhshiwu, sanshi, redFont, blueFont, yellowFont, blackFont, greenFont, whiteFont;
|
JMenuItem all, copy, past, refresh, shi, shiwu, ershi, erhshiwu, sanshi, redFont, blueFont, yellowFont, blackFont, greenFont, whiteFont, deleteUser;
|
||||||
JPopupMenu popupMenu;
|
JPopupMenu popupMenu;
|
||||||
JPanel showPan;
|
JPanel showPan;
|
||||||
JScrollPane scrollPane;
|
JScrollPane scrollPane;
|
||||||
@@ -86,6 +86,7 @@ public class MainPage extends JFrame implements ActionListener {
|
|||||||
currentUser = new JMenuItem("当前用户");
|
currentUser = new JMenuItem("当前用户");
|
||||||
userInfo = new JMenuItem("账号信息");
|
userInfo = new JMenuItem("账号信息");
|
||||||
signOut = new JMenuItem("退出登录");
|
signOut = new JMenuItem("退出登录");
|
||||||
|
deleteUser = new JMenuItem("注销账户");
|
||||||
|
|
||||||
|
|
||||||
//视图的子菜单
|
//视图的子菜单
|
||||||
@@ -140,6 +141,7 @@ public class MainPage extends JFrame implements ActionListener {
|
|||||||
userMenu.add(currentUser);
|
userMenu.add(currentUser);
|
||||||
userMenu.add(userInfo);
|
userMenu.add(userInfo);
|
||||||
userMenu.add(signOut);
|
userMenu.add(signOut);
|
||||||
|
userMenu.add(deleteUser);
|
||||||
|
|
||||||
//视图添加子菜单
|
//视图添加子菜单
|
||||||
viewMenu.add(exchangeBackground);
|
viewMenu.add(exchangeBackground);
|
||||||
@@ -400,8 +402,6 @@ public class MainPage extends JFrame implements ActionListener {
|
|||||||
checkBox2.setOpaque(false);
|
checkBox2.setOpaque(false);
|
||||||
checkBox3 = new JCheckBox("时间");
|
checkBox3 = new JCheckBox("时间");
|
||||||
checkBox3.setOpaque(false);
|
checkBox3.setOpaque(false);
|
||||||
checkBox4 = new JCheckBox("舱位");
|
|
||||||
checkBox4.setOpaque(false);
|
|
||||||
|
|
||||||
|
|
||||||
JPanel checkBoxPan = new JPanel();
|
JPanel checkBoxPan = new JPanel();
|
||||||
@@ -411,7 +411,6 @@ public class MainPage extends JFrame implements ActionListener {
|
|||||||
checkBoxPan.add(checkBox1);
|
checkBoxPan.add(checkBox1);
|
||||||
checkBoxPan.add(checkBox3);
|
checkBoxPan.add(checkBox3);
|
||||||
checkBoxPan.add(checkBox2);
|
checkBoxPan.add(checkBox2);
|
||||||
checkBoxPan.add(checkBox4);
|
|
||||||
this.add(checkBoxPan);
|
this.add(checkBoxPan);
|
||||||
|
|
||||||
seekBtn = new JButton();
|
seekBtn = new JButton();
|
||||||
@@ -507,7 +506,7 @@ public class MainPage extends JFrame implements ActionListener {
|
|||||||
|
|
||||||
|
|
||||||
//底部显示栏
|
//底部显示栏
|
||||||
JLabel bottomLab = new JLabel("当前登录者:");
|
JLabel bottomLab = new JLabel("当前登录者:" + Login.usernameTextField.getText());
|
||||||
bottomLab.setBounds(0, 500, 1000, 50);
|
bottomLab.setBounds(0, 500, 1000, 50);
|
||||||
this.add(bottomLab);
|
this.add(bottomLab);
|
||||||
|
|
||||||
@@ -743,6 +742,10 @@ public class MainPage extends JFrame implements ActionListener {
|
|||||||
if (e.getSource() == past) {
|
if (e.getSource() == past) {
|
||||||
showInfo.paste();
|
showInfo.paste();
|
||||||
}
|
}
|
||||||
|
if (e.getSource() == deleteUser) {
|
||||||
|
new DeleteUser();
|
||||||
|
this.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -50,7 +50,7 @@ public class RefundPage extends JFrame implements ActionListener {
|
|||||||
nameLab.setFont(font);
|
nameLab.setFont(font);
|
||||||
JLabel idCardLab = new JLabel("身份证号:");
|
JLabel idCardLab = new JLabel("身份证号:");
|
||||||
idCardLab.setFont(font);
|
idCardLab.setFont(font);
|
||||||
JLabel flightNumberLab = new JLabel("航 班 号:");
|
JLabel flightNumberLab = new JLabel("机票编号:");
|
||||||
flightNumberLab.setFont(font);
|
flightNumberLab.setFont(font);
|
||||||
|
|
||||||
nameTextField = new JTextField(27);
|
nameTextField = new JTextField(27);
|
||||||
|
After Width: | Height: | Size: 230 KiB |
After Width: | Height: | Size: 78 KiB |
After Width: | Height: | Size: 727 B |
After Width: | Height: | Size: 822 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 905 B |
After Width: | Height: | Size: 230 KiB |
After Width: | Height: | Size: 78 KiB |
After Width: | Height: | Size: 727 B |
After Width: | Height: | Size: 822 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 905 B |