wood burning stoves 2.0*
The moose likes JSF and the fly likes JSF and SWING components Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF and SWING components" Watch "JSF and SWING components" New topic
Author

JSF and SWING components

Shaiju scientia
Greenhorn

Joined: Jan 17, 2006
Posts: 15
Hi,
I came across the following article
http://www.roseindia.net/jsf/actionListener.shtml
Where it showing swing component ,JOptionPane.showMessageDialog(null,"Hi"), being rendered using JSF.
Is it possible to use Swing component with JSF ? If this is true, I guess we can have a lot more flexible components and rendered using JSF.
What is the down side of this ? can anybody throw some light?

Shaiju
sammaiah kyatham
Ranch Hand

Joined: Aug 03, 2003
Posts: 104
Hello,

You shouldn't use swing components for web based applications. Swing is meant for developing window based(thik) client applications. Here in this article, JOptionPane is used just to demonstrate the flexibility of using JSF but you shouldn't use JFrames/JButtons etc to render on browser. JSF has it's own components library for web applications.

Hope it helps.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15632
    
  15

Shaiju. you're hurting yourself by not abiding by our naming requirements (http://www.javaranch.com/name.jsp). A lot of us don't bother to answer questions from until people fix their display names. In your case it's cost you at least 2 days.


Customer surveys are for companies who didn't pay proper attention to begin with.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
Swing components are rendered on the server, not on the client. It only works in this case because the client and the server run on the same machine - which will not be the case in real life.

My recommendation is to ignore roseindia.net - it is full of bad code and bad practices.


Ping & DNS - updated with new look and Ping home screen widget
 
Consider Paul's rocket mass heater.
 
subject: JSF and SWING components
 
Similar Threads
how to call javascript function from jsf
JSF : Differenc e between attribute and property of a component
JSF and Swing
A newbie to MVC Architecture,components in JFC
JSF: component-family, component type and renderer relation.