完成了订单界面和租车系统界面,还完成了功能部分的添加租车信息和租车人信息
import javax.swing.;
import java.awt.;
import java.awt.event.*;
public class zuchexitong {
JFrame mainframe;
JButton listbtn,deletebtn;
Container con;
JTextArea text;
JScrollPane jspane;
JMenuBar mainmenu;
JMenu filemenu;
JMenuItem openitem,exititem;
JPanel panel;
public zuchexitong(){
mainframe = new JFrame("租车系统");
con = mainframe.getContentPane();
text = new JTextArea();
jspane = new JScrollPane(text);
listbtn = new JButton("列表显示");
deletebtn = new JButton(" 删除 ");
panel = new JPanel();
panel.add(listbtn);
panel.add(deletebtn);
createMenu();
mainframe.setJMenuBar(mainmenu);
con.add(panel,BorderLayout.SOUTH);
con.add(jspane,BorderLayout.CENTER);
mainframe.setSize(400, 300);
mainframe.setVisible(true);
mainframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
mainframe.setLocation(d.width/2-mainframe.getWidth()/2, d.height/2-mainframe.getHeight()/2);
}
public void createMenu(){
mainmenu = new JMenuBar();
filemenu = new JMenu("租车");
mainmenu.add(filemenu);
openitem = new JMenuItem("打开");
exititem = new JMenuItem("关闭");
filemenu.add(openitem);
filemenu.add(exititem);
}
public static void main(String[] args) {
// TODO Auto-generated method stub
new zuchexitong();
}
}
import javax.swing.*;
import java.awt.;
import java.awt.event.;
public class dingdan {
JFrame frame;
Container con;
JLabel label;
JPanel panel;
JScrollPane jspane;
JTextArea text;
public dingdan(){
frame = new JFrame("订单");
con = frame.getContentPane();
text = new JTextArea();
Icon picture = new ImageIcon("1.jpg");
label = new JLabel(picture);
panel = new JPanel();
panel.add(label);
jspane = new JScrollPane(text);
con.add(panel,BorderLayout.NORTH);
con.add(jspane,BorderLayout.CENTER);
frame.setSize(400, 300);
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
frame.setLocation(d.width/2-frame.getWidth()/2, d.height/2-frame.getHeight()/2);
}
public static void main(String[] args) {
// TODO Auto-generated method stub
new dingdan();
}
}
public class cheliang {
private String name;
private int price;
private int numbers;
private int day;
public cheliang(String name,int price,int numbers) {
cheliang[] cheliang1 = {new cheliang("奥迪",500,100),
new cheliang("奔驰",500,100)};
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getPrice() {
return price;
}
public void setPrice(int price) {
this.price = price;
}
public int getNumbers() {
return numbers;
}
public void setNumbers(int numbers) {
this.numbers = numbers;
}
public int getDay(){
return day;
}
public void setDay(int day){
this.day = day;
}
public int heji(){
int sum = pricenumbersday;
return sum;
}
public static void main(String[] args) {
// TODO Auto-generated method stub
}
}
import java.util.ArrayList;
public class zucheren {
private ArrayList
public zucheren(){
notes = new ArrayList
}
public void addzucheren(String note){
notes.add(note);
}
public int numbersofnotes(){
return notes.size();
}
public String shownote(int notenumber){
if(notenumber<0)
return null;
else if(notenumber<numbersofnotes()){
return notes.get(notenumber) ;
}
else
return null;
}
public void removenotes(int numbernote){
if(numbernote<0){
}
else if(numbernote<numbersofnotes()){
notes.remove(numbernote);
}
else{};
}
public String listnotes(){
String notestring = "";
for (String note : notes) {
notestring = notestring + note+"
";
}
return notestring;
}
public static void main(String[] args) {
// TODO Auto-generated method stub
}
}