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!
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.
...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
Joined: Dec 16, 2002
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
Joined: Jul 26, 2005
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.
Joined: Dec 16, 2002
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.