📄 customerlogquery.java
字号:
package customer.services.frame;
import java.awt.Color;
import java.awt.Font;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.List;
import javax.swing.JButton;
import javax.swing.JLabel;
import string.logic.GetCustomer;
import DBManager.SQLserver2000;
import MainFrame.MainFrame;
import MainFrame.MyFrame;
import customer.po.MoneyLog;
import customer.services.action.CustomerAction;
public class CustomerLogQuery extends MyFrame implements ActionListener {
/**
*
*/
private static final long serialVersionUID = 1L;
private JLabel username;
private JLabel money;
private JLabel moneyLog;
private JLabel moneyState;
private JLabel moneyDate;
private JButton ok;
public CustomerLogQuery(MainFrame m) {
super(m);
initialize(m.getTitle());
}
private void initialize(String title) {
String IDcard = new GetCustomer().getIDcard(title);
String result = new CustomerAction().getBalance(IDcard);
username = new JLabel();
username.setText("身份证号:"+IDcard);
username.setFont(new Font("黑体",Font.BOLD,20));
username.setBounds(new Rectangle(15, 5, 400, 100));
moneyLog = new JLabel();
moneyLog.setText("操作历史记录:");
moneyLog.setFont(new Font("黑体",Font.BOLD,20));
//moneyLog.setForeground(Color.red);
moneyLog.setBounds(new Rectangle(15, 35, 200, 100));
moneyState = new JLabel();
moneyState.setText("操作状态:");
moneyState.setFont(new Font("黑体",Font.BOLD,17));
moneyState.setForeground(Color.red);
moneyState.setBounds(new Rectangle(15, 55, 200, 100));
moneyDate = new JLabel();
moneyDate.setText("操作时间:");
moneyDate.setFont(new Font("黑体",Font.BOLD,17));
moneyDate.setForeground(Color.red);
moneyDate.setBounds(new Rectangle(215, 55, 200, 100));
money = new JLabel();
money.setText("余额:"+result);
money.setFont(new Font("黑体",Font.BOLD,20));
money.setBounds(new Rectangle(315, 5, 200, 100));
System.out.println(IDcard);
this.initMoneyLog(IDcard);
ok = new JButton();
ok.setText("确定");
//ok.setFont(new Font("黑体",Font.BOLD,20));
ok.setBounds(new Rectangle(380, 335, 100, 30));
ok.addActionListener(this);
this.add(username);
this.add(money);
this.add(moneyLog);
this.add(moneyState);
this.add(moneyDate);
this.add(ok);
this.setTitle(title);
this.setBounds(300,200,520,390);
}
public static void main(String[] args) {
}
public void initMoneyLog(String IDcard){
List<MoneyLog> MoneyLog = new CustomerAction().getMoneyLog(IDcard);
System.out.println(MoneyLog.size()+"MoneyLog");
int up = 115 , down = 75 , left = 100 ,right =100;
if(MoneyLog.size()<20){
for(int i =0;i<MoneyLog.size();i++){
JLabel JL = new JLabel();
JL.setText(MoneyLog.get(i).getMoneyLog());
JL.setBounds(new Rectangle(up, down, left, right));
JLabel JLM = new JLabel();
JLM.setText(MoneyLog.get(i).getLogDate());
JLM.setBounds(new Rectangle(up+200, down, left+100, right));
this.add(JL);
this.add(JLM);
down+=15;
}
}
System.out.println(MoneyLog.size()+"aaaaaaaaa");
}
public void Paint(String star , String end ){
}
public void actionPerformed(ActionEvent e) {
if(m!=null)
m.setVisible(true);
dispose();
SQLserver2000.closeDB();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -