Exemplo n.º 1
0
  private void showInvoice() {
    // Get the currently selected subscription
    int rowNumber = jTable1.convertRowIndexToModel(jTable1.getSelectedRow());
    String invoiceId = (String) model.getValueAt(rowNumber, 0);
    Invoice invoice = new Invoice();
    invoice.readInvoice(Integer.parseInt(invoiceId));

    // Show popup
    Application.getInstance().showPopup(new InvoicePopup(invoice));
  }
Exemplo n.º 2
0
  private void updateTable() {

    // First, empty it.
    model.setRowCount(0);

    // Secondly, fill it with all invoices
    ArrayList<Invoice> invoices = Invoice.readAll();

    // In reverse order (so newest is on top)
    Collections.reverse(invoices);

    for (Invoice invoice : invoices) {
      model.addRow(invoice.getTableRowObjects(true));
    }
  }