wood burning stoves*
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 Spring in Action this week in the Spring 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: 16141
    
  21

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: 42276
    
  64
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 - my free Android networking tools app
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSF and SWING components