• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Embed Swing Inside Servlet

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have a requirement to display folders & files in tree structure with drag & drop facility
in a web application. I am using Tomcat, JSP, Servlet. I tried to use AJAX for File Tree but.
It is very slow, since I have millions of files & folders. I have a sample of swing application
which gives File Tree feature with Drag & Drop. It is a stand alone application. I want to embed
this swing application inside my servlet, so that it can be accessible through the web.

Can anybody help me in this regard.

Thanks
Monoranjan
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The only way to deliver Swing components to the client is to use applets or Java Web Start. Then, you would still have the same problem that you have showing the files using AJAX. You would, somehow, need to move that huge list of files and directories from the server down to the client over the internet.
 
Monoranjan Gorai
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ben,
Thanks for your reply. Can you give me sample code please?
 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think AJAX is the better solution.

1.if you use applet,the client must install jvm or java web start.the process is quite disgust.

2.beacuse of millions of files,applet can not imporve the speed either.the speed mainly depends on the speed of the internet.

3.javascript is not such a slow technology in your mind.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I have a sample of swing application
which gives File Tree feature with Drag & Drop. It is a stand alone application. I want to embed
this swing application inside my servlet, so that it can be accessible through the web.



The only reason the Swing app appears fast is that it can talk directly to the operating system. For a client-server application you will have to proceed in small steps, only transmitting the file information for a single directory tree at one time with a new request/response cycle every time a directory is opened or closed. On the server side you will have to track the user's "current" directory and also have a mechanmism for limiting access for security.

Bill
 
The City calls upon her steadfast protectors. Now for a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic