文件名称:GourmetCoffeeGUI
- 所属分类:
- JSP源码/Java
- 资源属性:
- [Java] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 4kb
- 下载次数:
- 0次
- 提 供 者:
- E*
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
This Work graded 100
class SaveSalesListener implements ActionListener {
/**
* Saves the sales informations in a file.
*
* @param event the event object.
*/
public void actionPerformed(ActionEvent event) {
if (sales.getNumberOfOrders() == 0) {
statusTextArea.setText("No order has been sold.")
}
else {
fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY)
int result = fileChooser.showSaveDialog(null)
if (result != JFileChooser.APPROVE_OPTION) {
statusTextArea.setText("The sales information has " +
"not been saved.")
}
else {
File file = fileChooser.getSelectedFile()
try {
PrintWriter output = new PrintWriter(
new FileWriter(file))
output.print(salesFormatter.formatSales(sales))
output.close()
}
catch (IOException ioe) {
statusTextArea.setText("Error: Problem with I/O.") -This Work graded 100
class SaveSalesListener implements ActionListener {
/**
* Saves the sales informations in a file.
*
* @param event the event object.
*/
public void actionPerformed(ActionEvent event) {
if (sales.getNumberOfOrders() == 0) {
statusTextArea.setText("No order has been sold.")
}
else {
fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY)
int result = fileChooser.showSaveDialog(null)
if (result != JFileChooser.APPROVE_OPTION) {
statusTextArea.setText("The sales information has " +
"not been saved.")
}
else {
File file = fileChooser.getSelectedFile()
try {
PrintWriter output = new PrintWriter(
new FileWriter(file))
output.print(salesFormatter.formatSales(sales))
output.close()
}
catch (IOException ioe) {
statusTextArea.setText("Error: Problem with I/O.")
class SaveSalesListener implements ActionListener {
/**
* Saves the sales informations in a file.
*
* @param event the event object.
*/
public void actionPerformed(ActionEvent event) {
if (sales.getNumberOfOrders() == 0) {
statusTextArea.setText("No order has been sold.")
}
else {
fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY)
int result = fileChooser.showSaveDialog(null)
if (result != JFileChooser.APPROVE_OPTION) {
statusTextArea.setText("The sales information has " +
"not been saved.")
}
else {
File file = fileChooser.getSelectedFile()
try {
PrintWriter output = new PrintWriter(
new FileWriter(file))
output.print(salesFormatter.formatSales(sales))
output.close()
}
catch (IOException ioe) {
statusTextArea.setText("Error: Problem with I/O.") -This Work graded 100
class SaveSalesListener implements ActionListener {
/**
* Saves the sales informations in a file.
*
* @param event the event object.
*/
public void actionPerformed(ActionEvent event) {
if (sales.getNumberOfOrders() == 0) {
statusTextArea.setText("No order has been sold.")
}
else {
fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY)
int result = fileChooser.showSaveDialog(null)
if (result != JFileChooser.APPROVE_OPTION) {
statusTextArea.setText("The sales information has " +
"not been saved.")
}
else {
File file = fileChooser.getSelectedFile()
try {
PrintWriter output = new PrintWriter(
new FileWriter(file))
output.print(salesFormatter.formatSales(sales))
output.close()
}
catch (IOException ioe) {
statusTextArea.setText("Error: Problem with I/O.")
(系统自动生成,下载前可以参看下载内容)
下载文件列表
GourmetCoffeeGUI.java