I like to center the data of this array using Joptionpane i look at string.format and other but nothing helps i want something like all the information in the matrix its alight whit each other and a "|" to separete the information of each column
the information in data doesnt alignt
score [0][0]="Empresa "
score [0][1]="Guanacaste";
score [0][2]="Alajuela";
score [0][3]="Heredia";
score [0][4]="San Jose";
score [0][5]="Cartago";
score [0][6]="Limon";
score [0][7]="Puntarenas";
score [0][8]="Total";
score [0][9]="Porcentaje";
score [1][0]="SOIN"+" ";
score [2][0]="AVANTICA"+" ";
score [3][0]="INNOVASOFT ";
score [4][0]="CRUX"+" "+" ";
score [5][0]="NCQ"+" "+" ";
this is the array : String [][] score= new String[6][10];
public static void Output() {
int l = 0;
String data = "";
if (score[0][0] != (null)) {
while (l < score.length) {
for (int i = 0; i < 10; i++) {
if (score[l][i] == null) {
score[l][i] = "0";
}
data += " | " + score[l][i];
if (i == 9) {
data += " |";
}
}
l++;
data += "\n";
}
JOptionPane.showMessageDialog(null, data);
} else {
JOptionPane.showMessageDialog(null, "No se han ingresado datos", "Datos ingresados", JOptionPane.INFORMATION_MESSAGE);
}
}