// null value been assign to masterList for (int a=0; a<masterList.length; a++) { masterList[a] = null; }
//2nd array list -- listOfFiles File folder = new File("D:/nita/eclipse workspace/bufferedReader/image"); File[] listOfFiles = folder.listFiles();
for (int u=0; u<listOfFiles.length; u++) { //for the listOfFiles get the filename String aaa = listOfFiles[u].getName(); char[] bbb = aaa.toCharArray(); // turn the name to char
//assign 0-3 index char first = bbb[0]; char second = bbb[1]; char third = bbb[2]; char fourth = bbb[3];
//convert form char to string String s1=String.valueOf(first); String s2=String.valueOf(second); String s3=String.valueOf(third); String s4=String.valueOf(fourth);
//put all the value of s1-s4 in xxx String y = new String (s1 + s2 + s3 + s4 );
//validation for the first letter (only digit allow) if (Character.isLetter(first)) {
} else { int yInt = Integer.parseInt(y); //convert to integer // the int will be your index for the list masterList[yInt] = aaa;
} }//end of FOR loop
//put everything back to masterList ... did not display the null value... for (int h=0; h<masterList.length; h++) { if (masterList[h] != null) { System.out.println(masterList[h]); } }
hi friend, i know some answer u try after u call me(09885212778).this is not answer just one idea. you put all ur photos in one array.when u want read one bye one(u press next) u pushed in to stack.when u want previous u call pop() it will give previous photo). if any misstakes in this topic u also tell me.and send mail to me my mail id veerendra786@gmail.com