• Post Reply Bookmark Topic Watch Topic
  • New Topic

jpeg control  RSS feed

 
peter m hayward
Ranch Hand
Posts: 105
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am developing an application that renames jpegs of a book according to the input in a Jtextfiled which in this case is the ISBN of the book.
Most of the time there are three jpegs per book front spine and back, on occasion the will be two additional one of possible damage to the book, so I have a jpanel with five jlabels on it each of which is loaded with a resized version of the jpeg, beneath each is a check box the purpose behind this is to allow selection by the operator as the five jpegs are loaded from a file in blocks of five at a time and they may not all be of the same book, typically the first three are and the far right two are of the next book, these will be moved along using array manipulation until are the jpegs in the file have been processed
My problem is that it take very little time to read the file process the jpegs produce the resized versions, but then it takes considerably longer time to check if the operator has selected the jpegs, so for the most part may initialisation code is working fine so why is it taking so long to do a similar thing when i click the button that triggers the renaming process
My system is windows xp pro 3 gig Pentium 4 and 2gig of ram JAVA 7
Netbeans 8.0
Both the folders containing the jpegs (source) named camera and (results ) named upload reside on the C drive
Here is the code for the check if operated selected a jpeg

Here is the code that checkSelected calls to rename the jpegs


 
Carey Brown
Saloon Keeper
Posts: 3323
46
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Based on what you provided I don't see anything "wrong". I might have a few suggestions though. You are "copying" files, not "renaming" them. Your copy method efficiency could be improved. Try this.

Another suggestion is to create threads to do the copying. Tying up the Swing thread while copying files is not a good idea. You could create a queue of files to be copied and let the copying be done in a background thread.
 
peter m hayward
Ranch Hand
Posts: 105
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the suggestion need to read up on it and see if it take any where regards pete
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!