You are on page 1of 1

import javax.swing.JFrame; import javax.swing.JScrollPane; import javax.swing.JTable; public class Affiche_tout extends JFrame{ Object [][]o = new Object[Bib.vec.

size()][5]; String []s = {"Nom","Ecrivain","Prix"}; JTable t = new JTable(o,s); JScrollPane l = new JScrollPane(t); public Affiche_tout(){ int j=0; for(int i=0;i<Bib.vec.size();i++){ o[i][j]=Bib.vec.get(i).getNom(); o[i][j+1]=Bib.vec.get(i).getEcrivain(); o[i][j+2]=Bib.vec.get(i).getPrix(); } getContentPane().add(l); setVisible(true); setTitle("Afficher toute la liste"); pack(); } public static void main(String[] args) { new Affiche_tout(); } }

You might also like