Save objects in a JTree but change the displayed name (java swing)? -


i have made jtree , filled objects fron arraylist. when display contents of jtree gui, dont want see memory address wherethe object stored, customized string.

for example: add object tree:

defaultmutabletreenode tempnode = new defaultmutabletreenode(workspaces.get(i)); 

and see on gui is:

package.workspace@1df38f3

i want alternative text instead of

package.workspace@1df38f3

to displayed. how can fix code support this?

jtree going call tostring function on items add , display that. if can write tostring workspace object fix problem. if can't modify workspace object should create wrapper object has tostring want.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -