J'ai un peu de difficulté à imprimer une matrice matricielle sur une boîte de dialogue. La matrice est un nombre entier et autant que j'ai compris j'ai besoin de le changer en chaîne?matrice d'impression dans la boîte de dialogue
de toute façon, voici le code:
public void print_Matrix(int row, int column)
{
for (int i = 0; i <= row; i++)
{
for (int j = 0; j <= column; j++)
{
JOptionPane.showMessageDialog(null, matrix_Of_Life);
}
}
ce que je dois faire pour imprimer un tableau dans la boîte de dialogue?
merci.
Qu'est-ce que matrix_Of_Life ressemble? Est-ce un tableau multidimensionnel? – Ham
public void set_Matrix (ligne int, colonne int) \t { \t \t matrice_Of_Life = nouvelle int [ligne] [colonne]; \t \t \t \t \t \t Random randomGenerator = new Aléatoire(); \t \t for (int i = 0; i <= row-1; ++ i) { \t \t \t \t \t for (int j = 0; j <= colonne 1; ++ j) \t \t \t { \t \t \t \t int randomInt = randomGenerator.nextInt (2); \t \t \t // pour le résultat aléatoire "0" ou "1" \t \t \t System.out.println ("Generated:" + randomInt); \t \t \t}} \t \t \t} – firestruq