By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,541 Members | 1,109 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,541 IT Pros & Developers. It's quick & easy.

MVC and Swing

P: n/a

Can anyone give me a recipe to handle the following problem:

I try to use Observable in the data model class and Observer in the view
class. But I'm unsure, how I can combine these with Swing model classes.
Is it better to use only Swing or only Observer/Observable? In my view
class (JFrame) I have a JListbox and if I select one entry, the view class
calls a method of the data model and the model class notifies its observer
(and this is also the view class). Is it better to enhance the default
model class of JListbox and to use the Listener functionality? Should I
add a new abstraction layer to my project, which represents the data for
the Swing objects (view - representation - data model)? The same problems
I have, when I use JTextfield or JButton, all of these can have models and
these models are not the data model of my project, but represents a part
of it for a specific view.

Is there a general solution?
Thanks a lot
Dec 25 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.