我的 prog 有这个可爱的问题(我是菜鸟)我想给我的 prog 一些动画,我希望拆分面板中的分隔线从 gbPanel.getHeight()(MAX height) 移动到 Border.getHeight ()(最小高度)使用 16 像素的表格行长度,如果我对变量执行 System.out.println,程序似乎可以创造奇迹但是!桌子上的分隔线和一切都等到时间结束才在窗口中显示出来......我第一次尝试解决它或至少检查原因是否是添加一个 Thread.sleep 但这只是让程序等待在 while 结束和窗口更新之前很多。然后我尝试强制窗口在一段时间内更新,但这也不起作用。有人介意帮助我吗?
/* this display one row of data and makes the splitpanel divider -16 with each row */
public void DespliegaTD() {
DefaultTableModel jModel = new DefaultTableModel();
jTable1.setModel(jModel);
jModel.setColumnIdentifiers(new Object[]{"Num","Tarjeta","Cuenta","Fecha Trx","Monto","Descripción","Tipo POS","Cod Resp", "Moneda","Autorización","MCC","Resultado"});
try {
ResultSet rs = Query(tDebito.getText(),cuenta.getText(),fechaInicio.getText(),fechaFinal.getText());
while (rs.next()){
if ((dbPane.getHeight()-(rs.getRow()*jTable1.getRowHeight())) >= (Border.getHeight()-1))
dbPane.setDividerLocation((dbPane.getHeight()-(rs.getRow()*jTable1.getRowHeight())));
jModel.addRow(new Object[] {rs.getRow(),rs.getString(1),rs.getString(2),dateFormat4.format(dateFormat3.parse(rs.getString(3))),rs.getString(4),rs.getString(5),rs.getString(6),rs.getString(7),rs.getString(8),rs.getString(9),rs.getString(10),rs.getString(11)});
}
} catch (SQLException ex) {
Logger.getLogger(BVtarjetas.class.getName()).log(Level.SEVERE, null, ex);
} catch (ParseException ex) {
Logger.getLogger(BVtarjetas.class.getName()).log(Level.SEVERE, null, ex);
}
}