I have the following code in actionPerformed:
if(e.getSource()==btShowQuestions){
for(int j=1;j<=gQuestionsAcross.length;j++){
taQuestionArea.append(gQuestionsAcross[j]);
taQuestionArea.append("\n"
;
}
}
when the button btShow Questions is clicked the elements of the array gQuestionsAcross are printed into the text area taQuestionsAcross. My problem is that some of the elements of the array are null and a blank line is printed for each of these null elements. Is they any condition that i can use so that only elements of the array that contain a string are printed thus leaving no blank lines in the text area?
if(e.getSource()==btShowQuestions){
for(int j=1;j<=gQuestionsAcross.length;j++){
taQuestionArea.append(gQuestionsAcross[j]);
taQuestionArea.append("\n"
}
}
when the button btShow Questions is clicked the elements of the array gQuestionsAcross are printed into the text area taQuestionsAcross. My problem is that some of the elements of the array are null and a blank line is printed for each of these null elements. Is they any condition that i can use so that only elements of the array that contain a string are printed thus leaving no blank lines in the text area?