import javax.swing.*;
import javax.swing.table.*;
import java.io.*;
import java.util.*;
public class selioC 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[]={"日期 "," 项目"," 金额 "," 收入/支出 "," 是否贷款 "," 还款日期 "};
Vector vector=new Vector();
AbstractTableModel tm;
JTable table;
JScrollPane scroll;
JButton btl;
TextField input1;
String inout;
String basename;
public selioC(String bn)
{
super("信用卡表收入/支出查询");
setLayout(new FlowLayout());
basename=bn;
btl=new JButton("确定");
btl.addActionListener(new java.awt.event.ActionListener(){
public void actionPerformed(ActionEvent e){sel();
dispose();}
});
JLabel l=new JLabel("查询收入/支出");
input1=new TextField(4);
add(l);
add(input1);
add("South", btl);
pack();
setSize(650,100);
setVisible(true);
}
public void sel()
{
initTable();
init();
}
public void init(){
f.setSize(500,500);
f.setLayout(new FlowLayout());
f.setVisible(true);
}
public void initTable(){
inout=input1.getText();
//---------------------------------------------------------------------------
tm=new AbstractTableModel(){
public int getColumnCount(){
return title.length;
}
public int getRowCount(){
return vector.size();
}
public Object getValueAt(int row,int column){
if(!vector.isEmpty()){
return ((Vector) vector.elementAt(row)).elementAt(column);
}else{
return null;
}
}
public void setValueAt(Object value,int row,int column){
}
public String getColumnName(int column){
return title[column];
}
//public Class getColumnClass(int c){
// return getValueAt(0,c).getClass();
上一页 [1] [2] [3] [4] [5] [6] [7] 下一页