• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

add Metadata to Tablecolumn

 
Matt Shallow
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Knute Snortum
Bartender
Pie
Posts: 2884
62
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Haven't tried it, but something like this?
 
Matt Shallow
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Matt Shallow
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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


 
Knute Snortum
Bartender
Pie
Posts: 2884
62
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can't test it, but try something like this:
 
Matt Shallow
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That looks very promising. Will have to give it a go in the morning as late here and my eyes are fried. Thanks!!
 
Matt Shallow
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Knute Snortum
Bartender
Pie
Posts: 2884
62
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I may need more code, but specifically, did you call a setCellValueFactory on the column this value should be displaying?
 
Matt Shallow
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Knute Snortum
Bartender
Pie
Posts: 2884
62
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey, maybe you don't need setCellFactory.  Maybe just setting the setCallValueFactory is enough.  Try:
 
Matt Shallow
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Matt Shallow
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry did not mean to put all in the quote area. I cannot edit also=(
 
Knute Snortum
Bartender
Pie
Posts: 2884
62
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Matt Shallow
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.......=)




 
Knute Snortum
Bartender
Pie
Posts: 2884
62
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for posting your solution and I'm glad you found something that works.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic