Bonjour à tous voila je travail sur un projet sous jbuilder, je c'est que cette question est tres redondante ( j'ai parcourus tout les articles du forum ainsi que les tuto de chez sun d'où je me suis d'ailleurs basé pour construire mon code), mais rien a faire la combobox ne veu pas s'afficher, pourtant jbuilder ne détecte pas d'erreurs, je suis depuis toute la matiné dessus et je commence un peu a perdre patience surtout que mon boss veux des progres rapides

Voici le code de mon model de table :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import javax.swing.DefaultCellEditor;
import javax.swing.JComboBox;
import javax.swing.JTable;
import javax.swing.table.AbstractTableModel;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableColumn;
 
class MyTableModel extends AbstractTableModel {
 
 
        private String[] columnNames = {"Date",
                                        "Echéance",
                                        "Mode_de_paiement",
                                        "Libellé",
                                        "Montant"};
        private Object[][] data = {
            {"", "",
            "", new Float(1.254), new Integer (5)},
        };
 
        public int getColumnCount() {
            return columnNames.length;
        }
 
        public int getRowCount() {
            return data.length;
        }
 
        public String getColumnName(int col) {
            return columnNames[col];
        }
 
        public Object getValueAt(int row, int col) {
            return data[row][col];
        }
 
 
        /*
         * JTable uses this method to determine the default renderer/
         * editor for each cell.  If we didn't implement this method,
         * then the last column would contain text ("true"/"false"),
         * rather than a check box.
         */
        public Class getColumnClass(int c) {
            return getValueAt(0, c).getClass();
        }
 
        /*
         * Don't need to implement this method unless your table's
         * editable.
         */
        public boolean isCellEditable(int row, int col) {
            //Note that the data/cell address is constant,
            //no matter where the cell appears onscreen.
            if (col < 2) {
                return false;
            } else {
                return true;
            }
        }
 
    public void setUpMode_de_paiement(JTable tableau2,
        TableColumn Mode_de_paiement) {
        setUpMode_de_paiement(tableau2, tableau2.getColumnModel().getColumn(3));
    //Set up the editor for the sport cells.
    JComboBox comboBox = new JComboBox();
    comboBox.addItem("Snowboarding");
    comboBox.addItem("Rowing");
    comboBox.addItem("Knitting");
    comboBox.addItem("Speed reading");
    comboBox.addItem("Pool");
    comboBox.addItem("None of the above");
    Mode_de_paiement.setCellEditor(new DefaultCellEditor(comboBox));
 
    //Set up tool tips for the sport cells.
    DefaultTableCellRenderer renderer =
            new DefaultTableCellRenderer();
    renderer.setToolTipText("Click for combo box");
    Mode_de_paiement.setCellRenderer(renderer);
 
}
        }
Et ici celui ci ou j'appel mon tableau :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
public JTable getTableau2() {
			if (tableau2 == null) {
				tableau2 = new JTable();
				tableau2.setColumnSelectionAllowed(true);
				MyTableModel model= new MyTableModel();
				tableau2.setModel(model);
 
			}
			return tableau2;
		}
Je pense que je ne suis pas loin d'y arrivé mais quelque chose doit m'échappé, dsl si cela parait facile je n'ai commencé qu'il y a 2 semaines..
Merci d'avance pour votre aide