第十四周作业完成情况

完成了订单界面和租车系统界面,还完成了功能部分的添加租车信息和租车人信息
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 notes;
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+"\n";
}
return notestring;
}

public static void main(String[] args) {
    // TODO Auto-generated method stub

}

}

转载于:https://www.cnblogs.com/liangjingjing123/p/5561045.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值