Sorting the Jtree Alphabetically in JAVA using Hibernate technology

I am debugging a Java App which is working with Hibernate.
It has a JTree in the main page which is filled dynamically form database and needed to be sorted out when it is shown.

I have tried to do the Sort in the query statement but it did not work.
I have also used some properties of the JTree like setSort() function in order to sort the JTree elements but it is still not working properly.

Do you have any Idea how to sort this JTree elements when the data are shown!?
Thanks!


Source: java

Leave a Reply