Skip to main content



      Home
Home » Eclipse Projects » e(fx)clipse » Populate TableView with ObservableMap(Problem to dinamically update the ObservableMap and TableView)
Populate TableView with ObservableMap [message #1823424] Thu, 26 March 2020 07:51 Go to next message
Eclipse UserFriend
Hi,

I have a ConcurrentHashMap that takes dinamically data from a JMS tail.

Then I need to populate a TableView with the data of the ConcurrentMap.
--

My idea is to use an ObservableMap that is populated by the ConcurrentHashMap.

1) How can I control if the data are dinamically passed from the Concurrent to the Observed?

My solution is:
ObservableMap<String, SystemTarget> entriesTarget= FXCollections.observableMap(targetMap);

2) How can I control if the rows number is changed in relation to the ObservableMap update?

My solution:
ObservableList<SystemTarget> obsList = FXCollections.observableArrayList(entriesTarget.values());

table.setItems(obsList);

Then,
I can see the rows, but they are not changed......

What am I doing wrong?

Thanks!!
Re: Populate TableView with ObservableMap [message #1823447 is a reply to message #1823424] Thu, 26 March 2020 15:32 Go to previous message
Eclipse UserFriend
ObservableList and ObservableMap don't monitor the collection you pass to them. You would need to propagate any changes from the original list/map.
Previous Topic:Java 11 e4 application :IllegalAccessError
Next Topic:Simple e4 fx application wont start up
Goto Forum:
  


Current Time: Thu Mar 20 15:29:40 EDT 2025

Powered by FUDForum. Page generated in 0.03104 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top