I am creating a jtable jprogressbar
for now I happen to display my music in the jtable
I will change music afterwards
but my biggest problem is to operate each progress bar for each music
I intend to use swingututies.invokelater or swingworker
I could have documented and saw on the API that one had to use one or the other
Thank you for your help
The jtable displays what is in the folder and plays the duration of the music that is 16 seconds each but I will change music afterwards to see if the progress bar ends well at the same time as the duration of each music
I do not know how to take it for the code
Should I do a loop array for all boxes (columns)?
I am thinking
Right now the ProgressRenderer isn't used anywhere. You need to tell the JTable to use it for rendering some column.
Unfortunately, the progress bars in the table will not be updated automatically like a regular progress bar. That's because the renderer controls in a JTable aren't the controls themselves, they are just use for rendering. For progress bars that means you get a snapshot. The trigger to update it comes not from the progress bar but from the table (most likely its table model). Indeterminate mode won't work properly, period. For non-indeterminate mode you need to tell the progress bar the current value for each column; that's one of the arguments to the getTableCellRendererComponent method.
java.io.FileNotFoundException: sounds (Accès refusé)
at java.base/java.io.FileInputStream.open0(Native Method)
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "javax.sound.sampled.AudioInputStream.getFormat()" because "audioInputStream" is null
I am trying to find how to get the lasts in seconds to insert them into the jtable, I do not know if it is possible
Here's the mistake
The jvm could not find the sounds file. Where is it located? It should be in the current directory when the program executes.
Looking at the code, it appears sounds is the name of a directory, not the name of a sound file. If that is the case, then the arg to the getAudioInputStream method needs to be changed to refer to a file that has sound. For example: files would be one of the files in the sounds folder.
For line 49, to get the durations in seconds
a bit like getName for the names of the songs,
there is no getduration inseconds, I'm looking for the APIs
Is there a way to display them with Get or other?
Seems like you only need seconds in a long not a double. And I'm guessing that even an int would hold the number of seconds that you're likely to be dealing with (check me on this). So this code needs some clean up. First of all change the return type of the method to be a long. Then change this code
No need to perform the division in floating point and no need to put the result in a temporary variable.
Lastly you'll have to change your row = Double... to row = Long....
One problem that you're going to have to clean up at some point is that you are not closing the input stream in the getSeconds() method. You will eventually run out of resources depending on how long your list of files is. The best way to guarantee that the resource is closed is by using try-with-resources. Sorry, I don't have a link to a tutorial but Google should help you find one.
Every time, I was not far, I even made a return 0
I did not think to do audiosystem.getaudioinPutstream (file) with AudioInputStream AudioInputStream
I was very bonded with cast with targetdataline with file
thank you again