This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
1) You don't need MouseListener, you need ActionListener: one for each button (Next and Previous)
2) Don't loop through the collection, get the next or previous result strnig, based on what button was clicked, and set it in the txtresult
1) No need of s,s1,s2,s3,s4, string and str variables, you can concatenate the result in the argument to v.addElement() itself.
2) There in no need to convert Vector into array, you can use the vector itself.
3) If you are using 1.5 or higher, go for generics, you can avoid the toString() call.
Thanks & Regards, Happy to help
Parimal Nanoti (SCJP 6)