Forums Register Login

add Metadata to Tablecolumn

+Pie Number of slices to send: Send
Hi all,

New here so please be kind=).

Just wondering how I can display Metadata from a Media file in a table Column.

I already have all rows populated with the media but I want to display in Metadata in the columns.




Thanks in advance for the help.

Matt
+Pie Number of slices to send: Send
Haven't tried it, but something like this?
+Pie Number of slices to send: Send
Yeah I have tried a few different versions. Always seems to be something. I am still trying to get my head around extracting the data from ObservableMap<string,object>

Is it possible to take all the elements from an object and put into Labels without using a listener?
Cheers
+Pie Number of slices to send: Send
This is my current attempt. I am able to update the cell with text taken from the ObservableMap. I am not however able to set the text for multiple values.

At the moment the cell is printing just the artist value. I would like it to print year, and album etc. I tried adding them all to a string but that does not seem to work.

any ideas?

They way I want it to look in cell is:

Artists: Value
Album: Value
Year: Value


1
+Pie Number of slices to send: Send
Can't test it, but try something like this:
+Pie Number of slices to send: Send
That looks very promising. Will have to give it a go in the morning as late here and my eyes are fried. Thanks!!
+Pie Number of slices to send: Send
 

Knute Snortum wrote:Can't test it, but try something like this:





So I gave this a go but coming across similar issues where there is definitely a value going into a list but it is showing blank. So it does not seem to want to set the text with that string. hmmm.
+Pie Number of slices to send: Send
I may need more code, but specifically, did you call a setCellValueFactory on the column this value should be displaying?
+Pie Number of slices to send: Send
 

Knute Snortum wrote:I may need more code, but specifically, did you call a setCellValueFactory on the column this value should be displaying?



I did not set a cellValueFactory I just put an if statement in your code to check the value coming from the observable list.

Maybe that is an issue also. I will see what I can do. There is not much more code to my table cell.

Cheers,
matt
+Pie Number of slices to send: Send
Hey, maybe you don't need setCellFactory.  Maybe just setting the setCallValueFactory is enough.  Try:
+Pie Number of slices to send: Send
 

Knute Snortum wrote:Hey, maybe you don't need setCellFactory.  Maybe just setting the setCallValueFactory is enough.  Try:



Hi again. I am using ListView and there is no setCellValueFactory method that I can use. Besides I am populating the ListView with Media Objects so I can play those when you double click the cell. By changing the value I would be getting rid of the ability to play the media.

I am thinking I might just create a class that can extract the Metadata separately and just call that class. Maybe a clunky approach but sure when I have hit a brick wall=)

Thanks again for all the help. This really is a great forum=)

Matt
+Pie Number of slices to send: Send
Sorry did not mean to put all in the quote area. I cannot edit also=(
+Pie Number of slices to send: Send
If you use the Preview button before the Submit button you can sometimes catch those kinds of problems before you post.

Sorry nothing worked for you.  Do post something when you find a solution.
+Pie Number of slices to send: Send
I managed to stumble upon a solution that works. It actually works really well. I don't really know why I was so adamant on trying to extract the metadata iand put into cells when I could have just done it this way. Oh well a learning curve.

So the solution was to just create the media elsewhere and put into a GridPane. Then create an observable List of GridPanes and assemble that into a ListView.

Here are the main two parts. Nothing really new but just how it works together. I have yet to test with my library class but I think it should work.

Thanks again for sticking around. I believe I have gotten smarterer.......=)




1
+Pie Number of slices to send: Send
Thanks for posting your solution and I'm glad you found something that works.
Your mother is a hamster and your father smells of tiny ads!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 815 times.
Similar Threads
JTable dynamic column problem
SWT/JFace
specify color for jtable column headings (each column heading color is different)
How to populate, clear and append records into JTable
Cell renderer for different JComboBox's in same column?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 13:24:46.