import java.util.Vector; import javax.swing.JFrame; import java.awt.event.*; public class TestAffichage { private static void createAndShowGUI() { final Affichage Affichage = new Affichage(); Affichage.setOpaque(true); //content panes must be opaque //Create and set up the window. JFrame frame = new JFrame("Affichage"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.addComponentListener(new ComponentListener(){ public void componentHidden(ComponentEvent e) { } public void componentMoved(ComponentEvent e) { } public void componentResized(ComponentEvent e) { Affichage.redessine(); } public void componentShown(ComponentEvent e) { } }); frame.addWindowListener(new WindowAdapter(){ public void windowOpened(WindowEvent ev){ Affichage.redessine(); } }); //Create and set up the content pane. frame.setSize(800,600); frame.setContentPane(Affichage); for (int ligne = 0;ligne<10;ligne++){ Vector rowData = new Vector(); rowData.addElement(ligne); rowData.addElement("Article"+ligne); rowData.addElement(10); rowData.addElement(10*ligne); Affichage.InsertRowData(rowData); } //Display the window. frame.setVisible(true); } public static void main(String[] args) { //Schedule a job for the event-dispatching thread: //creating and showing this application's GUI. javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { createAndShowGUI(); } }); } }