Esempio n. 1
0
  public void refresh() {
    try {

      DecimalFormat df = new DecimalFormat("#.00");

      ArrayList<BankAccountVO> vos = bankAccountBLService.getBankAccountList();
      // defaultTableModel.getDataVector().clear();
      Vector<Vector> data = new Vector<Vector>();
      for (BankAccountVO vo : vos) {
        String acc = vo.getAccountUser();
        BigDecimal balance = vo.getBalance();
        Vector<Object> item = new Vector<Object>();
        item.add(acc);
        item.add(df.format(balance));
        data.add(item);
        // defaultTableModel.addRow(data);
      }
      defaultTableModel.setDataVector(data, names);
      table.revalidate();
      table.updateUI();
    } catch (RemoteException e) {
      new TranslucentFrame(this, MessageType.RMI_LAG, Color.ORANGE);
    } catch (SQLException e) {
      System.out.println(e.getMessage());
    }
  }
Esempio n. 2
0
 private void refreshList() {
   if (isBLInited()) {
     defaultTableModel.getDataVector().clear();
     try {
       ArrayList<PayReceiptVO> payReceiptVOs =
           payReceiptBLService.getListByState(ReceiptState.SUBMITTED);
       ArrayList<TransferReceiptVO> transferReceiptVOs =
           transferReceiptBLService.getListByState(ReceiptState.SUBMITTED);
       Vector<Vector> data = new Vector<Vector>();
       for (PayReceiptVO vo : payReceiptVOs) {
         Vector<Object> item = new Vector<Object>();
         item.add(vo.getId());
         item.add("付款单");
         item.add(vo.print());
         data.add(item);
       }
       for (TransferReceiptVO vo : transferReceiptVOs) {
         Vector<Object> item = new Vector<Object>();
         item.add(vo.getTransferID());
         item.add("中转单");
         item.add(vo.print());
         data.add(item);
       }
       defaultTableModel.setDataVector(data, names);
       table.revalidate();
       table.updateUI();
     } catch (RemoteException e) {
       new TranslucentFrame(this, MessageType.RMI_LAG, Color.ORANGE);
     } catch (SQLException e) {
       System.out.println(e.getMessage());
     }
   } else {
     initBL();
   }
 }