我在jdialog1中已经有一个刷新方法 ,但是在jdialog2中调用后无效,jdialog1中可以实现
void showSortManagerSql(){
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}catch(ClassNotFoundException ce){
System.out.println(ce);
}
try{
Connection con=DriverManager.getConnection("jdbc:odbc:assetManage");
Statement s=con.createStatement();
ResultSet rs=s.executeQuery("select * from assetSort");
sortManagerSql.removeAllElements();
while(rs.next()){
Vector temp=new Vector();
temp.add(rs.getString(1));
temp.add(rs.getString(2));
temp.add(rs.getString(3));
temp.add(rs.getString(4));
sortManagerSql.add(temp);
}
model.setDataVector(sortManagerSql,sortManagerHead);
rs.close();
s.close();
con.close();
}catch(SQLException se){
System.out.println(se);
}
}
void showSortManagerSql(){
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}catch(ClassNotFoundException ce){
System.out.println(ce);
}
try{
Connection con=DriverManager.getConnection("jdbc:odbc:assetManage");
Statement s=con.createStatement();
ResultSet rs=s.executeQuery("select * from assetSort");
sortManagerSql.removeAllElements();
while(rs.next()){
Vector temp=new Vector();
temp.add(rs.getString(1));
temp.add(rs.getString(2));
temp.add(rs.getString(3));
temp.add(rs.getString(4));
sortManagerSql.add(temp);
}
model.setDataVector(sortManagerSql,sortManagerHead);
rs.close();
s.close();
con.close();
}catch(SQLException se){
System.out.println(se);
}
}
楼主【yuyistar】截止到2008-06-28 20:22:03的历史汇总数据(不包括此帖):
发帖数:58 发帖分:1290
结贴数:54 结贴分:1180
未结数:4 未结分:110
结贴率:93.10 % 结分率:91.47 %
值得尊敬
我想问题应该是在jdialog2中执行一段代码能够通知jdialog1执行刷新代码。这样就应该可以。