File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Swing application to JSF web application view Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Swing application to JSF web application view" Watch "Swing application to JSF web application view" New topic
Author

Swing application to JSF web application view

Georgios Chatziefstratiou
Ranch Hand

Joined: May 26, 2012
Posts: 73
Hi there

i have created a paint program in Swing.

It works great BUT they said me to transfer it to a Web application using JSF.

Does anyone knows how can i transfer it from swing to jsf the class is already there .
the logic will be the same my problem is how this will be viewed.

How to take away the JFrame and pass the logic to JSF view page and have the same functionality s (draw some lines in some colors).

Thanks in advanced
Volodymyr Levytskyi
Ranch Hand

Joined: Mar 29, 2012
Posts: 481
    
    1

Hello!

Maybe AjaxSwing can help you! Details on http://www.creamtec.com/products/ajaxswing/


True person is moral, false is right!
Georgios Chatziefstratiou
Ranch Hand

Joined: May 26, 2012
Posts: 73
Volodymyr Levytskyi wrote:Hello!

Maybe AjaxSwing can help you! Details on http://www.creamtec.com/products/ajaxswing/


No not really. Look this


how can i avoid opening


I need to open this Jframe but on jsf page if it is not on a jframe or in something else it's i really cannot understand it .
I have read about managed beans but i think i haven't understand something.
Any help?
Volodymyr Levytskyi
Ranch Hand

Joined: Mar 29, 2012
Posts: 481
    
    1

Hello!

I don't know anything about ajaxswing. I thought it could help!

I've heard that something as what you want can be performed by JApplet. Details on http://docs.oracle.com/javase/tutorial/deployment/applet/index.html
Georgios Chatziefstratiou
Ranch Hand

Joined: May 26, 2012
Posts: 73
Volodymyr Levytskyi wrote:Hello!

I don't know anything about ajaxswing. I thought it could help!

I've heard that something as what you want can be performed by JApplet. Details on http://docs.oracle.com/javase/tutorial/deployment/applet/index.html


Thanks for your reply .I have read that
but yes i try to avoid using applets.
Something else ?any idea.

Thanks in advanced.
Georgios Chatziefstratiou
Ranch Hand

Joined: May 26, 2012
Posts: 73
But if i think that every managed bean has to be implemented in a view then is very normal to use a bean !But How can i do it ?
I have already the Bean .The bean is the code i have put above but how can i show it to my jsf page .

Thats the problem ! Because i have to make the web page jsf page show what the Jframe now shows and convert it .
It has to be implemented so that the user can draw free like before .I have also search for jsf session s.A long way to the top.
Any help is most welcome.
Volodymyr Levytskyi
Ranch Hand

Joined: Mar 29, 2012
Posts: 481
    
    1

I don't understand why you don't like applets!

I am sure that you cannot provide by JSF something like JPanel or JFrame with its repaint() methods which do all immediately.

JSF is web framework and its job is to be on server and listen for HTTP requests coming from browser.
JSF is on server but Swing is on your desktop!

Maybe you should provide your own custom browser in Swing.

This browser can allow user to paint (when mouse is moved) and it allows to send HTTP requests.

Something like : new JEditorPane("http://www.google.com/");
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15641
    
  15

Because of the extra time delays involved in client/server applications running over the Internet, the only web-based paint programs I've ever seen did all their painting work in JavaScript, Flash, or as an applet where the real-time processing code can be can be executed locally instead of on the server.

One reason why Swing cannot be used in webapps is because not only are the protocols unsuitable, but Swing ultimately taps into the graphics card to do its rendering, and if the graphics card is in one computer, but the graphics terminal is in another computer... Whoops!


Customer surveys are for companies who didn't pay proper attention to begin with.
Georgios Chatziefstratiou
Ranch Hand

Joined: May 26, 2012
Posts: 73
Tim Holloway wrote:Because of the extra time delays involved in client/server applications running over the Internet, the only web-based paint programs I've ever seen did all their painting work in JavaScript, Flash, or as an applet where the real-time processing code can be can be executed locally instead of on the server.

One reason why Swing cannot be used in webapps is because not only are the protocols unsuitable, but Swing ultimately taps into the graphics card to do its rendering, and if the graphics card is in one computer, but the graphics terminal is in another computer... Whoops!


that means applets are one way to paint ?You suggest applets also ?Or do i have other way to implement it with jsf ?I have already the (bean) java class to paint ready that 's why i ask!
Georgios Chatziefstratiou
Ranch Hand

Joined: May 26, 2012
Posts: 73
Volodymyr Levytskyi wrote:I don't understand why you don't like applets!

I am sure that you cannot provide by JSF something like JPanel or JFrame with its repaint() methods which do all immediately.

JSF is web framework and its job is to be on server and listen for HTTP requests coming from browser.
JSF is on server but Swing is on your desktop!

Maybe you should provide your own custom browser in Swing.

This browser can allow user to paint (when mouse is moved) and it allows to send HTTP requests.

Something like : new JEditorPane("http://www.google.com/");

Interesting i will look at this and answer.Thanks.I will also re-think applets.
Volodymyr Levytskyi
Ranch Hand

Joined: Mar 29, 2012
Posts: 481
    
    1

To my mind it is the most popular and cool to use JavaScript for programs that run in browser.
Georgios Chatziefstratiou
Ranch Hand

Joined: May 26, 2012
Posts: 73
Volodymyr Levytskyi wrote:To my mind it is the most popular and cool to use JavaScript for programs that run in browser.

Yes but i already have the class it's working.That 's why i ask.
Georgios Chatziefstratiou
Ranch Hand

Joined: May 26, 2012
Posts: 73
Tim Holloway wrote:Because of the extra time delays involved in client/server applications running over the Internet, the only web-based paint programs I've ever seen did all their painting work in JavaScript, Flash, or as an applet where the real-time processing code can be can be executed locally instead of on the server.

One reason why Swing cannot be used in webapps is because not only are the protocols unsuitable, but Swing ultimately taps into the graphics card to do its rendering, and if the graphics card is in one computer, but the graphics terminal is in another computer... Whoops!



finnally i have it .I will do it like this



Back End (log in etc) in Java and drawing with javascript.

Take care
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Swing application to JSF web application view
 
Similar Threads
Should Swing application connect to Web application or directly to EJB tier?
How do I apply Model-View-Controller in Java Swing?
JAR the web-application or use WSDL/SOA ?!?!
JSF vs Swing
difference in: JSP / JSF and how convert JFrame