예제 #1
0
  public void ListaKontrahentow() {
    DefaultTableModel table = new DefaultTableModel();
    Kontrahent objKontrahent = new Kontrahent();
    ArrayList<Kontrahent> listaKontrahentow = new ArrayList();
    listaKontrahentow = objKontrahent.ListaKontrahentów();

    table.addColumn("id");
    table.addColumn("Skrót");
    table.addColumn("Nazwa");
    table.addColumn("NIP");
    table.setRowCount(listaKontrahentow.size());
    int i = 0;
    // System.out.println("lista size = " + lista3.size());
    for (Kontrahent x : listaKontrahentow) {
      table.setValueAt(x.getId(), i, 0);
      table.setValueAt(x.getSkrot(), i, 1);
      table.setValueAt(x.getNazwa(), i, 2);
      table.setValueAt(x.getNip(), i, 3);
      i++;
    }

    this.jTable1.setModel(table);
    jTable1.getColumnModel().getColumn(0).setMinWidth(0);
    jTable1.getColumnModel().getColumn(0).setMaxWidth(0);
    jTable1.getColumnModel().getColumn(0).setPreferredWidth(0);
  }
예제 #2
0
  private void jButtonWybierzActionPerformed(
      java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButtonWybierzActionPerformed

    Kontrahent objKontrahent = new Kontrahent();
    objKontrahent.znajdzKontrahenta(idpress);

    this.fak.setId_kontrahent(objKontrahent.getId());
    this.fakgui.ustawNazweKontrahenta(
        objKontrahent.getNazwa(),
        objKontrahent.getKod() + " " + objKontrahent.getMiasto(),
        objKontrahent.getUlica());

    this.dispose();
  } // GEN-LAST:event_jButtonWybierzActionPerformed