it is easier if you don't display workspace, nodes, items in one tree.
it is better that user choses its workspaces other ways,
then you display tree as tree nodes and items as properties of node
at least it is much easier this way while you have only one node type in your tree.
other wise if you insist showing them all in one tree, if you are using JSF you can use different facets for different node types (Worspace, node, item)
I think as nasim said the jackrabbit examples are very good for start
http://jackrabbit.apache.org/doc/firststeps.html
if you want a complete JCR browser here is one open source application:
http://sourceforge.net/projects/jcrbrowser
a more complete open source application can be found here:
http://www.jlibrary.org/
if you still need more help post another message on the list