資源簡(jiǎn)介
Java,mysql的超市管理系統(tǒng)大作業(yè),有用戶界面,包含開發(fā)文檔和代碼說明

代碼片段和文件信息
package?packer1;
import?java.awt.*;
import?java.awt.event.ActionEvent;
import?java.awt.event.ActionListener;
import?java.io.File;
import?java.io.FileInputStream;
import?javax.swing.*;
import?javax.swing.border.EmptyBorder;
public?class?Count?extends?JDialog?implements?ActionListener
{
Myframe?myframe;
private?final?JPanel?contentPanel?=?new?JPanel();
private?JPanel?panel;
private?JPanel?p1;
private?JPanel?p2;
private?JRadioButton?r1;
private?JRadioButton?r2;
private?JTextArea?ta;
private?JScrollPane?scrollPane;
private?String?record;
/**
?*?Launch?the?application.
?*/
/**
?*?Create?the?dialog.
?*/
public?Count(Myframe?myframe1)?
{
myframe=myframe1;
settitle(“統(tǒng)計(jì)“);
record=myframe.getrecord();
setBounds(600?275?850?496);
getContentPane().setLayout(new?BorderLayout());
contentPanel.setBorder(new?EmptyBorder(5?5?5?5));
getContentPane().add(contentPanel?BorderLayout.CENTER);
contentPanel.setLayout(new?BorderLayout(0?0));
ta?=?new?JTextArea();
ta.setEditable(false);
ta.setFont(new?Font(“宋體“?Font.PLAIN?20));
contentPanel.add(ta?BorderLayout.CENTER);
scrollPane?=?new?JScrollPane(ta);
contentPanel.add(scrollPane?BorderLayout.CENTER);
panel?=?new?JPanel();
contentPanel.add(panel?BorderLayout.SOUTH);
panel.setLayout(new?GridLayout(0?2?0?0));
p1?=?new?JPanel();
panel.add(p1);
r1?=?new?JRadioButton(“本次記錄“);
r1.setFont(new?Font(“宋體“?Font.PLAIN?20));
r1.addActionListener(this);
p1.add(r1);
p2?=?new?JPanel();
panel.add(p2);
r2?=?new?JRadioButton(“歷史記錄“);
r2.setFont(new?Font(“宋體“?Font.PLAIN?20));
r2.addActionListener(this);
p2.add(r2);
ButtonGroup?bg=new?ButtonGroup();
bg.add(r1);
bg.add(r2);
setVisible(true);
}
@Override
public?void?actionPerformed(ActionEvent?e)?{
//?TODO?自動(dòng)生成的方法存根
if(e.getSource()==r1)
{
ta.setText(record);
}
if(e.getSource()==r2)
{
File?file=new?File(“Transaction?record.txt“);?//交易記錄文件
if(!file.exists())
{
JOptionPane.showMessageDialog(this?“沒有歷史交易記錄“?“錯(cuò)誤“?JOptionPane.ERROR_MESSAGE);
}
else?
{
FileInputStream?in;
try?{
in=new?FileInputStream(file);
byte[]?buy=new?byte[1000000];
int?len=in.read(buy);
String?text=new?String(buy0len);
ta.setText(text);
in.close();
}?
catch?(Exception?e1)?{
//?TODO?自動(dòng)生成的?catch?塊
e1.printStackTrace();
}
}
}
}
}
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2019-03-13?12:37??超市管理系統(tǒng)\
?????文件?????2036609??2018-12-24?23:53??超市管理系統(tǒng)\mysql-connector-java-8.0.11.jar
?????文件????????2392??2018-12-27?19:32??超市管理系統(tǒng)\warehouse.sql
?????目錄???????????0??2019-03-13?12:36??超市管理系統(tǒng)\大作業(yè)\
?????文件????????3074??2018-12-27?19:07??超市管理系統(tǒng)\大作業(yè)\.classpath
?????文件?????????385??2018-12-25?20:41??超市管理系統(tǒng)\大作業(yè)\.project
?????目錄???????????0??2019-03-13?12:36??超市管理系統(tǒng)\大作業(yè)\.settings\
?????文件?????????598??2018-12-27?19:07??超市管理系統(tǒng)\大作業(yè)\.settings\org.eclipse.jdt.core.prefs
?????目錄???????????0??2019-03-13?12:36??超市管理系統(tǒng)\大作業(yè)\bin\
?????目錄???????????0??2019-03-13?12:36??超市管理系統(tǒng)\大作業(yè)\bin\packer1\
?????文件????????3565??2018-12-27?20:52??超市管理系統(tǒng)\大作業(yè)\bin\packer1\Count.class
?????文件?????????700??2018-12-27?20:40??超市管理系統(tǒng)\大作業(yè)\bin\packer1\Login$1.class
?????文件????????3737??2018-12-27?20:40??超市管理系統(tǒng)\大作業(yè)\bin\packer1\Login.class
?????文件???????10858??2018-12-27?20:52??超市管理系統(tǒng)\大作業(yè)\bin\packer1\Myfr
?????文件????????7803??2018-12-27?20:52??超市管理系統(tǒng)\大作業(yè)\bin\packer1\Purchase.class
?????文件????????8603??2018-12-27?20:52??超市管理系統(tǒng)\大作業(yè)\bin\packer1\Query.class
?????文件????????7785??2018-12-27?20:53??超市管理系統(tǒng)\大作業(yè)\bin\packer1\Sell.class
?????目錄???????????0??2019-03-13?12:36??超市管理系統(tǒng)\大作業(yè)\src\
?????目錄???????????0??2019-03-13?12:36??超市管理系統(tǒng)\大作業(yè)\src\packer1\
?????文件????????2593??2018-12-27?20:52??超市管理系統(tǒng)\大作業(yè)\src\packer1\Count.java
?????文件????????2575??2018-12-27?20:40??超市管理系統(tǒng)\大作業(yè)\src\packer1\Login.java
?????文件????????9820??2018-12-27?20:52??超市管理系統(tǒng)\大作業(yè)\src\packer1\Myfr
?????文件????????7212??2018-12-27?20:52??超市管理系統(tǒng)\大作業(yè)\src\packer1\Purchase.java
?????文件???????10179??2018-12-27?20:52??超市管理系統(tǒng)\大作業(yè)\src\packer1\Query.java
?????文件????????7047??2018-12-27?20:53??超市管理系統(tǒng)\大作業(yè)\src\packer1\Sell.java
?????文件?????????390??2019-03-12?23:11??超市管理系統(tǒng)\說明書.txt
?????文件??????942335??2019-03-13?12:37??超市管理系統(tǒng)\超市管理系統(tǒng)開發(fā)文檔.docx
- 上一篇:Thinking in Java mobi
- 下一篇:JAVA捕魚達(dá)人源碼
評(píng)論
共有 條評(píng)論