Meaningless Drivel is fun!
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
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF and SWING components" Watch "JSF and SWING components" New topic

JSF and SWING components

Shaiju scientia

Joined: Jan 17, 2006
Posts: 15
I came across the following article
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?

sammaiah kyatham
Ranch Hand

Joined: Aug 03, 2003
Posts: 104

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: 17410

Shaiju. you're hurting yourself by not abiding by our naming requirements ( 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.

An IDE is no substitute for an Intelligent Developer.
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
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 - it is full of bad code and bad practices.
I agree. Here's the link:
subject: JSF and SWING components
It's not a secret anymore!