Java Hashmap to JavaFX Treeview and Back?
<p>I have a nested <code>HashMap</code> which looks like this:</p>

<pre><code>Map&lt;String,Object&gt; myMap = new HashMap&lt;String,Object&gt;();
</code></pre>

<p>This <code>myMap</code> is nested, Like:</p>

<pre><code>String key =&gt; String val
String key =&gt; String val
String key =&gt; Map&lt;String,Object&gt; val
</code></pre>

<p>And then that value may contain another similar <code>Map&lt;String,Object&gt;</code>.
I do not expect it to be nested more than 3 levels.
The leafs or last values are always <code>String</code>.</p>

<p>Now I'm trying to make a way to edit this <code>HashMap</code> in a JavaFX GUI.</p>

<p>From what I have learnt so far,
the best way seems like making a editable JavaFX <code>TreeView</code>
and somehow translating the <code>Map</code> to a <code>TreeView</code> and back.</p>

<p>So far I'm thinking </p>

<pre><code>TreeMap&lt;String, Object&gt; treeMap = new TreeMap&lt;String, Object&gt;();
treeMap.putAll(myMap); 
</code></pre>

<p>And then somehow translating that <code>TreeMap</code> to a JavaFX <code>TreeView</code>.
But I can not figure out how to proceed.
Another headache is that after user edits I need to translate it all back to a <code>HashMap</code> such as the original <code>myMap</code>. Although sorting / sequence is not required.</p>