• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Drag and drop tree - JSP or Swing?

 
Kristy Peterson
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to add a tree that you can drag and drop components in (that are dynamically created from local DB). My application is J2EE-EJB with JSP's as my GUI. The only drag and drop tree's I have found can be done with extending JTree. Can I add a swing component to my J2EE application? We are looking to deploy it in WebSphere.
Thanks,
Kristy
 
Scott Duncan
Ranch Hand
Posts: 365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Swing works well for fat clients but not for JSPs. Unless you can install a swing client on each of your user's machines, then you will have to use JSPs only. I would imagine that Javascript will play an important part of this part of your application.
 
Scott Duncan
Ranch Hand
Posts: 365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ohh, yeah...
One other option would be to use an applet but swing is not compatible with most browsers unless you have a plug in. Therefore, you are stuck using AWT only and even then, your users will need the JRE installed which may be a problem for XP users.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you get by with something less than drag and drop? I frequently see two listboxes with arrows to move the selected line from one into the other. Eg our user admin app has a list of all available thingies and a list of thingies for this user. You can highlight a line in either and list hit the arrow button to move it to the other list.
 
Kristy Peterson
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your posts!
As far as the Swing goes, I read some information at this link: http://www.jguru.com/faq/view.jsp?EID=4144 that talks about not having a Plug-in and placing the swing jar on the web server. I haven't tried this yet and I don't know if it is the best solution. I haven't found javascript that will allow me to drag and drop within the same tree.
As far as the 2 lists, that is a good idea, except the tree needs to move around the nodes within itself.
I'm still a bit stumped. I found a great Swing solution from www.Infragistics.com (JSuite 6), but I don't know if Swing will work for us.
Kristy
 
Simon Brown
sharp shooter, and author
Ranch Hand
Posts: 1913
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Putting the swing.jar file is, in reality, something that we used to be able to do back in the days of JDK 1.1 and Swing 1.x. However, now Swing is part of the core Java platform, you can't actually get a swing.jar file anymore. Even if you did manage to extract all of the Swing classes, you'd probably find that they now rely on some of the newer core Java APIs.
Using the Java plug-in is certainly an option if you are running on an internal network, but I wouldn't really recommend it for an external (Internet) site because it will take a long time to download. Another option, if the end-users have the JDK installed, is to use Java Webstart - but I don't think that this is an option for you.
I would try to figure out if a solution is possible through a combination of JavaScript/DHTML/HTML - as Crash says.
Alternatively, and I've not tried this myself, you could use a Macromedia Flash component (or possibly an ActiveX control) - both of which can hook into a J2EE environment through various technologies including web services.
Hope that helps - good luck!
Simon
 
Kristy Peterson
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have actually thought about using Java Web Start. Do you see a reason why this would not work for me?
Thanks,
Kristy
 
Simon Brown
sharp shooter, and author
Ranch Hand
Posts: 1913
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am pretty sure that you have to have the JRE installed on the client machines for them to recognise the .jnlp files.
Simon
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic