VB个人理财管理系统(流程图+论文+源程序) 第3页
自上而下分别为:贷款情况、信用卡收入、现金收入、收支查询、信用卡查询、的代码,
5.3现金的收支模块的设计与实现
1、流程图:2、运行界面:
1.实现过程代码:插入现金表:
import java.sql.*;
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class insm extends JFrame{
Connection con;
Statement sta;
ResultSet rs;
String driver= "com.microsoft.jdbc.sqlserver.SQLServerDriver";
String url= "jdbc:microsoft:sqlserver://localhost:1433";
public JFrame frame;
TextField input1,input2,input3,input4,input5,input6;
JButton btl;
public String basename;
String date1=null,pro=null,money=null,che=null;
public insm(String bn)
{
super("插入到现金表");
setLayout(new FlowLayout());
JPanel t1 = new JPanel();
t1.setLayout(new GridLayout(1,0));
add("North", t1);
JPanel t2 = new JPanel();
btl=new JButton("确定");
basename=bn;
btl.addActionListener(new java.awt.event.ActionListener(){
public void actionPerformed(ActionEvent e){in();}
});
add("South", btl);
JLabel l=new JLabel("日期");
input1=new TextField(4);
JLabel year=new JLabel("年-");
input2=new TextField(3);
JLabel month=new JLabel("月-");
input3=new TextField(3);
JLabel day=new JLabel("日");
JLabel l1=new JLabel(" 项目 ");
input4=new TextField(4);
JLabel l2=new JLabel(" 金额");
input5=new TextField(4);
JLabel l3=new JLabel(" 收入/支出");
input6=new TextField(4);
t1.add(l);
t1.add(input1);
t1.add(year);
t1.add(input2);
t1.add(month);
t1.add(input3);
t1.add(day);
t1.add(l1);
t1.add(input4);
t1.add(l2);
t1.add(input5);
t1.add(l3);
t1.add(input6);
pack();
setSize(1000,100);
setVisible(true);
}
public void in()
{
connection();
ins();
dispose();
}
public void connection()
{
try{
Class.forName(driver);
con = DriverManager.getConnection(url,"sa",null);
sta = con.createStatement();
}catch(Exception e)
{
e.printStackTrace();
}
}
public void ins(){
date1=input1.getText()+"-"+input2.getText()+"-"+input3.getText();
pro=input4.getText();
money=input5.getText();
che=input6.getText();
String sql="USE "+basename+"的个人理财数据库 insert into 现金收入支出表 values('"+date1+"','"+pro+"',"+money+",'"+che+"')";
try{
rs = sta.executeQuery(sql);
}catch(Exception e)
{
e.printStackTrace();
}
}
public void close(){
try{
if(con!= null)
con.close();
con=null;
}catch(Exception e){
e.printStackTrace(); }
}
}
5.4信用卡收支模块的设计与实现
1流程图:运行界面:
下面把此界面的主要代码作一介绍:
显示信用卡表:
import java.io.IOException;
import java.sql.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.table.*;
import java.io.*;
import java.util.*;
public class showtablec extends JFrame{
JFrame f=new JFrame("信用卡收入支出表");
Connection con;
Statement sta;
ResultSet rs;
String driver= "com.microsoft.jdbc.sqlserver.SQLServerDriver";
String url= "jdbc:microsoft:sqlserver://localhost:1433";
String title[]={"日期 "," 项目"," 金额 "," 收入/支出 "," 是否贷款 "," 还款日期 "};
上一页 [1] [2] [3] [4] [5] [6] [7] 下一页