Can someone give me an example of application/framework/tool in java/jdk library that is based on MVC design pattern? I was asked this question at an interview recently. I replied that most of the java swing components are designed based on MVC. But the interviewer said he is looking for something more complex than that. Thanks.
The Java base Java EE stack can be considered MVC, if you use objects as the models, jsps as the views, and servlets as the controllers.
Spring MVC would be another example of a popular library that is based off MVC.
Apache Struts is an example of such framework.
Apache OFBiz, but i don't recommend it's usage for bussiness.
Struts is probably the largest most popular pure MVC framework in use, though it is feeling its age and SPRING which is more AOP, is out there as well.
When talking about JavaSE, an MVC framework is Swing (or at least something close to it), as you pointed out. I don't really understand what he meant for "something more complex" but there are other options like EclipseRCP.
Eclipse is well known as an IDE, but basically, it is a desktop application built upon a framework that every user can use to build his/her custom desktop application, since it's open source. It is "more complex" than Swing (even though Swing is complex enough) because they are compound of multiple layers out of the box. From the OSGI implementation (which is the most basic piece of software) to the top layer in which you can find structures as views, editors, perspectives, commands, add-ons, etc.
In general terms we can say that in EclipseRCP intermediate layers, the V is the Eclipse SWT library (the components), the C is the Eclipse JFace library and the M is the model of your own application. At the top layer, all of the "complex" structures I mentioned in my previous paragraph (perspectives, views, editors, etc.) are also part of the C as well, but in a higher level.
It's the closest thing I can think of regarding an MVC framework for JavaSE (excluding Swing). The last version of it (Eclipse E4) has made a good cleanup of the complexity so I don't know if that is "complex enough" to answer the question. If you want to know more information read this tutorial about Eclipse E4.
And, by the way, with the Netbeans platform you could also implement a desktop-based application following an MVC approach (or at least something similar) and it's based in Swing.
I am also struggled with mvc in past and i learnt alot now,see this tutorial mvc simple program(adding two numbers)