Win a copy of Terraform in Action this week in the Cloud forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

From Web interface to Swing

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All!
I've a J2EE app (Servlets, Ejb ecc) with a web interface. The client has requested a Swing as application interface. The problem is that this appl. uses hardly the creation,saving and visualizzation of pdf, word and excel documents. What is the best way to adopt from the Swing point of view?
Thanks a lot in advance!
 
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you asking how to invoke existing servlets from a Swing app?
 
Angelino Dolce
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Roger!

No, the problem is: How to call MS Word or MS Excel or Acrobat reader from a swing application (for example by clicking a JButton)?
Thanks!
 
Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://j-integra.intrinsyc.com/support/com/doc/ocx/Acrobat_OCX.html

Thank google.com
 
Ranch Hand
Posts: 311
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Angelino,

Originally posted by Angelino Dolce:
... uses [heavily] the creation, saving and visualization of pdf, word and excel documents.


... that is a presentation task logically residing in the presentation tier between client tier and business [server] tier.

Originally posted by Angelino Dolce:
What is the best way to adopt from the Swing point of view?


How and how much presentation tier tasks are given to the client or to the server depends on the technology used:

- In web based architectures ...
... the client (=browser) can not do those tasks. Therefore the server plays this presentation tier role.

- In Swing based architectures ...
... as much as possible of those _presentation_ tier tasks should be moved to the Swing application because it is no business task and otherwise would unnecessarily slow down the server. Ideal would be to move those document generation to the client app.

On the other hand in your case the documents also be saved, probabely to the server, maybe for reasons of auditing acceptability, and the latter is no longer a presentation but a _business_ task. Therefore I would consider also the document-generation be [a presentation and] a business task, and would leave it at the server.

Probabely your customer expects to get the same user guidance. If so then you might provide 1 new Swing window per 1 old HTML page.

Print a hardcopy of the old HTML pages and group / separate all HTML components by lines. So you get your new Swing layout as a kind of grid, preferrably as a GridBagLayout.

Hope this gives you some good ideas,
Thomas
 
Thomas Taeger
Ranch Hand
Posts: 311
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Angelino Dolce:

...How to call MS Word or MS Excel or Acrobat reader from a swing application (for example by clicking a JButton)?



What was button or a <FORM ... SUBMIT ...> action in HTML now in Swing needs to be a listener method of a Swing button, TextField or whatever Swing component. This Listener method does nothing new! It just delegates the logically same command [and data if any] to a server method. This _server_ method then calls the document generating as before, do not let the client directly start that!

Your only task is to replace the
- HTML components and actions with
- Swing components, listeners and server-calls.

Good luck,
Thomas
 
Thomas Taeger
Ranch Hand
Posts: 311
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Kris Reid:
Thank google.com



Ok, Angelino, Swing is a hard stuff.

Besides other good Swing books you may find page 55 to 378 of "The Java Almanac 1.4, VOLUME 2(!)" (=Swing) helpful. It is a collection of short snippets, like a cookbook.

But before that you might need a good Swing book too - for the basics of Swing components, listeners etc..

For how to connect from client to server it depends on whether you want to connect to a Servlet (similar to now?) or directly to a session EJB (that you will need to lookup), but that is an own topic.

Good luck again.
Thomas
 
Angelino Dolce
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Thomas!
The problem is more simple:
I've risolved the problems of communication ecc ecc.
Let make this simple:
How can I open a Ms Word Document from a java swing application? How can I call MS Word? (Or Ms Excel or Acrobat Reader - or another Windows application?). Whai is a gud strategy: JNI for example or
System.run... -) ecc???;
Thank You again.
 
Thomas Taeger
Ranch Hand
Posts: 311
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Angelino Dolce:
How can I open a Ms Word Document from a java swing application? How can I call MS Word? (Or Ms Excel or Acrobat Reader - or another Windows application?). Whai is a gud strategy: JNI for example or
System.run... -) ecc???;



How did the server do it before? Leave it (at the server side) like it is and just let the client access the server. What could be simpler than this?

The client should open an exe only if it were client-side, and that should not be, as I argued before.

Thomas
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic