aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes From Web interface to Swing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "From Web interface to Swing" Watch "From Web interface to Swing" New topic
Author

From Web interface to Swing

Angelino Dolce
Greenhorn

Joined: Jul 26, 2005
Posts: 24
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!
Roger Chung-Wee
Ranch Hand

Joined: Sep 29, 2002
Posts: 1683
Are you asking how to invoke existing servlets from a Swing app?


SCJP 1.4, SCWCD 1.3, SCBCD 1.3
Angelino Dolce
Greenhorn

Joined: Jul 26, 2005
Posts: 24
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!
Kris Reid
Ranch Hand

Joined: Jan 05, 2005
Posts: 247
http://j-integra.intrinsyc.com/support/com/doc/ocx/Acrobat_OCX.html

Thank google.com
Thomas Taeger
Ranch Hand

Joined: Dec 16, 2002
Posts: 307
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


www.classic-and-class.com - www.evalulearn.com
Interfaces are the glue of OO.
Thomas Taeger
Ranch Hand

Joined: Dec 16, 2002
Posts: 307
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

Joined: Dec 16, 2002
Posts: 307
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

Joined: Jul 26, 2005
Posts: 24
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

Joined: Dec 16, 2002
Posts: 307
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: From Web interface to Swing