How To Display 2D Array Data Using Java NetBeans
In this Java Tutorial we will see How To Display Values From A Multidimensional Array Into A jTextArea Using For Loop In Java NetBeans .
Project Source Code:
public void showData(){
String[][] data = {
{"A1","B1","C1","D1","E","F","G"},
{"A2","B2","C2","D2","E","F","G"},
{"A3","B3","C3","D3","E","F","G"},
{"A4","B4","C4","D4"},
{"A5","B5","C5","D5"},
{"A6","B6","C6","D6"},
{"A7","B7","C7","D7"},
};
String txt = "";
for(int i = 0; i < data.length; i++){
for(int c = 0; c < data[i].length; c++){
//jTextArea1.setText(jTextArea1.getText() + "");
txt = txt + data[i][c] + " , ";
}
txt = txt + "\n";
}
jTextArea1.setText(txt);
}
3 comments
commentsOnly the sound is not enough or for example text, like some that do not have a sound, to explain, otherwise everything is fine.
ReplyMany thanks.
Only the sound is not enough or for example text, like some that do not have a sound, to explain, otherwise everything is fine.
ReplyMany thanks.
Nice poost thanks for sharing
Reply