• 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

Swing application to JSF web application view

 
Ranch Hand
Posts: 106
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 514
1
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello!

Maybe AjaxSwing can help you! Details on http://www.creamtec.com/products/ajaxswing/
 
Georgios Chatziefstratiou
Ranch Hand
Posts: 106
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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?
 
Bin Smith
Ranch Hand
Posts: 514
1
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 106
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 106
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Bin Smith
Ranch Hand
Posts: 514
1
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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/");
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!

 
Georgios Chatziefstratiou
Ranch Hand
Posts: 106
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 106
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Bin Smith
Ranch Hand
Posts: 514
1
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To my mind it is the most popular and cool to use JavaScript for programs that run in browser.
 
Georgios Chatziefstratiou
Ranch Hand
Posts: 106
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 106
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic