Shall I use java swing class in creator 2?

Hi,

I am using Creator 2 to develop a web application, in which I need to create tree node dynamically (I know about the Creator 2 tutorial on how to generat tree node dynamically, but it is a completely different scenario in my case).

Because I did not find any general purpose treenode class in java.util, I used javax.swing.tree.DefaultMutableTreeNode, which worked well. However, I was told by my supervisor that I should create my own treenode if I can not find one in java.util, because it is not good to mix Swing class with classes especially desgined for Creator 2.

I feel it is like reinvent the wheel if I am to write my own treenode. Could you please give me your opinions on it, so that I can be sure before rewriting my code?

Thanks :)

[782 byte] By [javasfana] at [2007-10-3 2:49:53]
# 1

> I am using Creator 2 to develop a web application, in

> which I need to create tree node dynamically (I know

> about the Creator 2 tutorial on how to generat tree

> node dynamically, but it is a completely different

> scenario in my case).

What is all this stuff about creating something "dynamically"?

> Because I did not find any general purpose treenode

> class in java.util, I used

> javax.swing.tree.DefaultMutableTreeNode, which worked

> well. However, I was told by my supervisor that I

> should create my own treenode if I can not find one

> in java.util, because it is not good to mix Swing

> class with classes especially desgined for Creator 2.

First: writing a custom TreeNode probbaly takes less time than it took you to post here. Second: don't expect anyone here to know about "Creator 2". This isn't product support here. I have no idea what it is and don't know what its special classes would be, but IMO you're well-advised to stay clear of whatever those are. Third: I wouldn't know why you couldn't use a Swing tree model to create a tree model. I don't think that Swing is the problem. If anything, then that Creator 2 stuff is.

CeciNEstPasUnProgrammeura at 2007-7-14 20:38:41 > top of Java-index,Java Essentials,Java Programming...
# 2
Thanks for your reply.I have posted my message on the "tools and product" forum, but nobody answered, so I thought I will try my luck here.Thanks again for your answer, at least I have a bit more confidence to use Swing class in Creator 2 now.
javasfana at 2007-7-14 20:38:41 > top of Java-index,Java Essentials,Java Programming...
# 3

> Thanks again for your answer, at least I have a bit

> more confidence to use Swing class in Creator 2 now.

Ask your supervisor for a reason about how a data container class from namespace X is worse than a data container class from namespace Y. It's not like you're using GUI widgets, and the Swing classes are part of every J2SE JRE. Which is absolutely not the case of those "special classes" you're talking about.

But when in doubt, do what the boss says. If it takes longer and/or is more expensive, it'll be his fault that way and not yours.

CeciNEstPasUnProgrammeura at 2007-7-14 20:38:41 > top of Java-index,Java Essentials,Java Programming...
# 4
Many thanks!Your answer is so convincing! I am going to tell my boss about that.Thanks again, and hava a nice day.
javasfana at 2007-7-14 20:38:41 > top of Java-index,Java Essentials,Java Programming...