Usage of JTree and JSeperator

Anyone know how (and if) to use the JTree bean. I would love to fill it with data and use it to navigate through hierachical data.

Is it even possible? Or does Servoy need to implement their version of this control.

Same questions for the JSeperator. How and if to use it.

I would love to see this feature too!

And what about JSplitPane??? :D I could really use that one…

pbakker:
And what about JSplitPane??? :D I could really use that one…

With JSeperator I actually meant JSplitPane :oops:

ROCLASI:
Anyone know how (and if) to use the JTree bean. I would love to fill it with data and use it to navigate through hierachical data.

Is it even possible? Or does Servoy need to implement their version of this control.

Today I wrote a very basic method that uses Jtree as a navigator, but I don’t know if it’s possible to attach a Servoy method to an element of the tree.

Is it possible? :)

Hi Servoyians,

There hasn’t been any comment of the questions in this tread…

I’m very interested in using the JTree bean, but no idea how to get it going and like ricardino asked: is it possible to let an element of the tree trigger Servoy Methods…

Any comment appreciated

Paul

pbakker:
Hi Servoyians,

There hasn’t been any comment of the questions in this tread…

I’m very interested in using the JTree bean, but no idea how to get it going and like ricardino asked: is it possible to let an element of the tree trigger Servoy Methods…

Any comment appreciated

Paul

I haven’t used to many beans personally, but I can make an educated guess about how you’ll likely interact with them.

Since beans are small chunks of Java code then they likely work with explicit input and output parameters. You’ll need to determine what those parameters are and supply them to the bean. I haven’t read the following article but there is more there about beans.

http://www.servoymagazine.com/modules.php?op=modload&name=News&file=article&sid=5

I can imagine that some beans will take input that may be Java code itself so you may need to learn a bit about doing stuff in Java. Fortunately, moving from Javascript to PHP to Java is pretty similar. It’s all a matter of learning the nuances of the environment and syntax.

Doing a search for jtree on Google will give you some results and tutorials. Here is one I found right off the bat.

http://www.apl.jhu.edu/~hall/java/Swing-Tutorial/Swing-Tutorial-JTree.html

Hope this helps.

Mattman,

thanks for the response. I allready looked around on the net, but the docs there do not get me going… :( And the doc on Beans on Servoy Magazine does not tell me what I’m looking for either…

Ricardino, you say you wrote a basic method to use the JTree as navigator… would you be willing to share?

I’m trying to fill the tree with my own data, but haven’t figured it out.

Paul

pbakker:
Mattman,

Ricardino, you say you wrote a basic method to use the JTree as navigator… would you be willing to share?

I’m trying to fill the tree with my own data, but haven’t figured it out.

Paul

Sure. But I’ve only been able to put my values inside the tree, nothing more.
Put the bean on a form, give it a name and check the Property “Editable”.
Assign the names you want to the various elements, then uncheck the editability (to avoid user’s deletions or modifications).

The method (very “filemakerish” ;) is

var modulo = elements.jtree.selectionPath
if ( utils.stringPatternCount(modulo, "anagrafica") > 0 )
{
globals.Vai_Anagrafica();
}
if ( utils.stringPatternCount(modulo, "anamnesi") > 0 )
{
globals.Vai_Anamnesi();
}

I stopped at this point: hope it helps :)

I have struggled too, with this option: Jtree. (and many others)

My question is, is it possible to use it?
Or is it just wasted energy?

I can’t figure it out, how to use it in Servoy!

Ricardino, tnx for the info, I’ll continue my struggle from here onwards… :D

HJK: I have the same issue and judging from the comments on bean implementation, eveyone seems to have them.

Servoy people: Is it possible to use these beans inside Servoy? If so, could you give us some pointers as how to implement them?

The article on the Servoy Magazine website deals with beans that just display some data. I think what we’re all looking for is implementation of beans have more interaction with the application, like the JTree, JSeperator, Jsplitpane etc.

Paul

In addition to the previous:

What I allready tried is searching the web, but all examples there do not seem to work. Now, I’m a novice here, but I think my problem lies in properly addressing the element through scripting.

The examples on the web (scripting wise) seem to be on another level as the scripting done in the method editor in Servoy.

What I’m first trying to do is just a simple Add of anaother ‘node’ to a tree. Can’t get this to work. Getting all kind of error messages…

Ideally, I want to fill the tree with my own data and trigger methods based of which ‘node’ is selected.

Paul

Currently swing components (JSplitPane/JTree) are difficult to use inside servoy. Because for that you really need a full fleged java IDE for that. Because those beans/components aren’t really for use by just settings some properties and it works..

We do have on the planning to give you a JTree component as a special Servoy element. That is then simple and easy to use.
And we will see if we also can do the same for the JSplitpane.

Johan,

Tnx for the quick reply… :)

So, is it just very difficult or not possible to use these beans now? If it’s very difficult, is it still possible to give us some pointer as to how?

I wonder, because what about other beans then?

And for the incorporation of JSplitpane and JTree into Servoy: Any idea when this will happen?

Paul

A JTree will not be really doable. It is the most complex bean of Swing . Beause what do you want to do with a jtree bean? Fill it with values and then what? When you click on a node you want to trigger an action? That is currently not possible.

A JSplitPane will be possible to use i think. Just do this:

drop a jsplitpane bean in the designer.. (name it split)
drop 2 fields or buttons/labels in the designer
and name one left and the other right.

then make a script
elements.split.rightComponent = elements.right;
elements.split.leftComponent = elements.left;

and attach that script to the onload method of that form.

I would like to use the tree as navigator, so yes, by selecting a node trigger a method. The feature that is interesting is that you can have different icon per ‘node’, something I wasn’t able to do in listview.

As for te Splitpane: the interesting bit will be if we can put two forms on there, for example two listviews. I tried this. It’s not possible directly, but if you place a tabpanel (with the form you want in your splitpanel) on the form you have your splitpane, you can get a form into the splitpane. :D

Haven’t tried if everything still works but at least it looks good…

Any idea when we can see JTree implementation in a beta?

Paul

Hello People,

I wondered if there is any news on using the JTree bean.

Are there still plans to implement this in Servoy in the very near future?

And if so could you give us an idea when.

I got some real use for it on several solutions and I`m wondering weather or not to wait building them.

Thanks in advance Rene

it will be finalised directly after the release of 2.0

do you have some sort of Beta so we can get an idea :lol:

jcompagner:
it will be finalised directly after the release of 2.0

Did the implementation of the JTree make it in 2.1 final?

I am trying to build an email-client. Jtree is offen used for this.